mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-12-23 22:11:10 +02:00
* Refactored errors * Make monitoring and errorreport accept `errctx.Error` instead of `error` * Add server.Error; Remove category from errctx; Make HTTP handlers respond with *server.Error * Remove stackSkip from errctx.Wrap; Add errctx.WrapWithStackSkip
19 lines
440 B
Go
19 lines
440 B
Go
package format
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
|
|
"github.com/imgproxy/imgproxy/v3/errctx"
|
|
)
|
|
|
|
// FormatSegmentName formats segment name string
|
|
func FormatSegmentName(name string) string {
|
|
return strings.ReplaceAll(strings.ToLower(name), " ", "_")
|
|
}
|
|
|
|
// FormatErrType formats error type string with error concrete type
|
|
func FormatErrType(errType string, err error) string {
|
|
return fmt.Sprintf("%s_error (%s)", errType, errctx.ErrorType(err))
|
|
}
|