Copyright | (c) 2023 GYELD GMBH |
---|---|
License | Apache 2.0 |
Maintainer | [email protected] |
Stability | develop |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
Synopsis
- class IsGYApiError e where
- toApiError ∷ e → GYApiError
- data GYApiError = GYApiError {}
- 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
IsGYApiError GYApiError # | |
Defined in GeniusYield.HTTP.Errors |
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.
Instances
IsGYApiError GYApiError # | |
Defined in GeniusYield.HTTP.Errors | |
Exception GYApiError # | |
Defined in GeniusYield.HTTP.Errors | |
Show GYApiError # | |
Defined in GeniusYield.HTTP.Errors | |
Eq GYApiError # | |
Defined in GeniusYield.HTTP.Errors (==) ∷ GYApiError → GYApiError → Bool # (/=) ∷ GYApiError → GYApiError → Bool # |
someBackendError ∷ Text → GYApiError #
Create a typical BACKEND_ERROR internal serval error with given message.