Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProcessHTTPError ¶
func ProcessHTTPError(err error, w http.ResponseWriter, _ *http.Request)
ProcessHTTPError writes formated error response to w
Types ¶
type ServerErrorData ¶
type ServerErrorData struct { Parent error `json:"-"` Code int `json:"code,omitempty"` Message string `json:"message,omitempty"` Description string `json:"description,omitempty"` Stack string `json:"-"` }
ServerErrorData is custom error that should be used to describe better errors
func ServerError ¶
func ServerError(Parent error, Code int, Message string) *ServerErrorData
ServerError Create error object
func (*ServerErrorData) Error ¶
func (e *ServerErrorData) Error() string
type ServerErrorLoginRequired ¶
type ServerErrorLoginRequired struct { *ServerErrorData LoginRequired bool `json:"login_required,omitempty"` }
ServerErrorLoginRequired is server error that can provide info if login is required
type ServerErrorWithText ¶
type ServerErrorWithText struct { *ServerErrorData ErrorText string `json:"error,omitempty"` }
ServerErrorWithText extra text
Click to show internal directories.
Click to hide internal directories.