Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- module Gargantext.API.Errors.Types
- module Gargantext.API.Errors.Class
- data GargErrorScheme
- backendErrorToFrontendError :: BackendInternalError -> FrontendError
- frontendErrorToServerError :: FrontendError -> ServerError
- frontendErrorToGQLServerError :: FrontendError -> ServerError
- showAsServantJSONErr :: BackendInternalError -> ServerError
Documentation
module Gargantext.API.Errors.Types
module Gargantext.API.Errors.Class
Types
data GargErrorScheme #
GES_old | The old error scheme. |
GES_new | The new error scheme, that returns a |
Instances
Show GargErrorScheme # | Error scheme for GraphQL, has to be slightly different {errors: [{message, extensions: { ... }}]} https://spec.graphql.org/June2018/#sec-Errors |
Defined in Gargantext.API.Errors showsPrec :: Int -> GargErrorScheme -> ShowS # show :: GargErrorScheme -> String # showList :: [GargErrorScheme] -> ShowS # | |
Eq GargErrorScheme # | |
Defined in Gargantext.API.Errors (==) :: GargErrorScheme -> GargErrorScheme -> Bool # (/=) :: GargErrorScheme -> GargErrorScheme -> Bool # |
Conversion functions
backendErrorToFrontendError :: BackendInternalError -> FrontendError #
Transforms a backend internal error into something that the frontend
can consume. This is the only representation we offer to the outside world,
as we later encode this into a ServerError
in the main server handler.
frontendErrorToServerError :: FrontendError -> ServerError #
Converts a FrontendError
into a ServerError
that the servant app can
return to the frontend.