Documentation ¶
Index ¶
- type ApiError
- func AttributeMismatchError(raw_error string, message string) ApiError
- func AuthorizationError(raw_error string, message string) ApiError
- func DatabaseError(raw_error string, message string) ApiError
- func InternalError(raw_error string, message string) ApiError
- func MalformedRequestError(raw_error string, message string) ApiError
- func UnknownError(raw_error string, message string) ApiError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiError ¶
type ApiError struct { Status int `json:"status"` Type string `json:"type"` Message string `json:"message"` RawError string `json:"raw_error,omitempty"` }
* * Status - the HTTP error code to be sent to the client - should be set by constructor * Type - the broad category - e.g. DatabaseError, AuthorizationError, InternalError * Message - provides additional details on the specific error that occurred. * RawError - the raw error (stringified) that caused the panic. It is only included in the response * to the client, if the config variable DEBUG_MODE is set to true. In other cases, the * field is set to the empty string, which causes its omission when encoded to JSON. *
func AttributeMismatchError ¶
Used when the user attempts to perform an action that is not permitted as part of the flow. E.g. Attempting to check-in without having RSVPed.
func AuthorizationError ¶
An error that occurs when an incoming request comes without a JWT token in the Authorization header.
func DatabaseError ¶
An error that occurs when a database operation (e.g. fetch / insert / update) doesn't work.
func InternalError ¶
Represents errors in the system, including failures in inter-service API calls. If there are multiple possible sources of an error, we use this error.
func MalformedRequestError ¶
An error for when struct validation fails, or there are other issues with the payload to an endpoint.
func UnknownError ¶
Represents errors in the system whose cause is unidentified.