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
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
Show GYApiError # | |
Defined in GeniusYield.HTTP.Errors | |
Eq GYApiError # | |
Defined in GeniusYield.HTTP.Errors (==) ∷ GYApiError → GYApiError → Bool Source # (/=) ∷ GYApiError → GYApiError → Bool Source # |
someBackendError ∷ Text → GYApiError #
Create a typical BACKEND_ERROR internal serval error with given message.