Copyright | (c) 2023 GYELD GMBH |
---|---|
License | Apache 2.0 |
Maintainer | support@geniusyield.co |
Stability | develop |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- class IsGYApiError e where
- toApiError ∷ e → GYApiError
- data GYApiError = GYApiError {
- gaeErrorCode ∷ Text
- gaeHttpStatus ∷ Status
- gaeMsg ∷ Text
- someBackendError ∷ Text → GYApiError
Documentation
class IsGYApiError e where #
Class of types that can be converted into an HTTP API error.
Nothing
toApiError ∷ e → GYApiError #
default toApiError ∷ Exception e ⇒ e → GYApiError #
Instances
data GYApiError #
An example error code can be: INSUFFICIENT_BALANCE (i.e. it is not the HTTP status error message)
The message can be any textual representation of the error with more information.
The status code should be the HTTP status code.
GYApiError | |
|
Instances
Eq GYApiError # | |
Defined in GeniusYield.HTTP.Errors (==) ∷ GYApiError → GYApiError → Bool # (/=) ∷ GYApiError → GYApiError → Bool # | |
Show GYApiError # | |
Defined in GeniusYield.HTTP.Errors |
someBackendError ∷ Text → GYApiError #
Create a typical BACKEND_ERROR internal serval error with given message.