Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Errors messages BAD_ERROR string = "error text doesn't match. Won't `%s`, but got `%s`" BAD_CODE string = "error code don't match. Won't `%d`, but got `%d`" BAD_TYPE string = "error type don't match. Won't `%v`, but got `%v`" INTERNAL HttpErrorType = iota EXTERNAL )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpError ¶
type HttpError struct {
Type HttpErrorType
StatusCode int
// contains filtered or unexported fields
}
func NewExternalHttpError ¶
func NewInternalHttpError ¶
func (HttpError) Append ¶
Add new info to error description. For example:
error "internal error" + error "fatal error" = error "internal error;\nfatal error"
func (HttpError) CompareWith ¶
Return nil, if errors not different
func (HttpError) WithFuncName ¶
Change func name, which will be logged
func (HttpError) Write ¶
func (herr HttpError) Write(w http.ResponseWriter)
type HttpErrorType ¶
type HttpErrorType int
Click to show internal directories.
Click to hide internal directories.