Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Code
- = AccessDenied
- | ActionWebhookCode !Text
- | AlreadyExists
- | AlreadyTracked
- | AlreadyUntracked
- | BadRequest
- | BigQueryError
- | Busy
- | ConcurrentUpdate
- | CoercionError
- | Conflict
- | ConstraintError
- | ConstraintViolation
- | CustomCode !Text
- | CyclicDependency
- | DataException
- | DataConnectorError
- | DependencyError
- | InvalidConfiguration
- | InvalidHeaders
- | InvalidJSON
- | InvalidParams
- | JWTInvalid
- | JWTInvalidClaims
- | JWTRoleClaimMissing
- | MSSQLError
- | MethodNotAllowed
- | NotExists
- | NotFound
- | NotSupported
- | ParseFailed
- | PermissionDenied
- | PermissionError
- | PostgresError
- | PostgresMaxConnectionsError
- | RemoteSchemaConflicts
- | RemoteSchemaError
- | StartFailed
- | Unexpected
- | UnexpectedPayload
- | ValidationFailed
- data QErr = QErr {}
- data QErrExtra
- = ExtraExtensions Value
- | ExtraInternal Value
- overrideQErrStatus :: Status -> Code -> QErr -> QErr
- prefixQErr :: Text -> QErr -> QErr
- showQErr :: QErr -> Text
- noInternalQErrEnc :: QErr -> Value
- encodeGQLErr :: Bool -> QErr -> Value
- encodeQErr :: Bool -> QErr -> Value
- err400 :: Code -> Text -> QErr
- err404 :: Code -> Text -> QErr
- err405 :: Code -> Text -> QErr
- err401 :: Code -> Text -> QErr
- err409 :: Code -> Text -> QErr
- err429 :: Code -> Text -> QErr
- err500 :: Code -> Text -> QErr
- type QErrM m = MonadError QErr m
- throw400 :: QErrM m => Code -> Text -> m a
- throw404 :: QErrM m => Text -> m a
- throw405 :: QErrM m => Text -> m a
- throw401 :: QErrM m => Text -> m a
- throw409 :: QErrM m => Text -> m a
- throw429 :: QErrM m => Code -> Text -> m a
- throw500 :: QErrM m => Text -> m a
- internalError :: Text -> QErr
- throw500WithDetail :: QErrM m => Text -> Value -> m a
- modifyQErr :: QErrM m => (QErr -> QErr) -> m a -> m a
- modifyErr :: QErrM m => (Text -> Text) -> m a -> m a
- modifyErrA :: ArrowError QErr arr => arr (e, s) a -> arr (e, (Text -> Text, s)) a
- liftTxtMod :: (Text -> Text) -> QErr -> QErr
- modifyErrAndSet500 :: QErrM m => (Text -> Text) -> m a -> m a
- liftTxtMod500 :: (Text -> Text) -> QErr -> QErr
- withPathE :: ArrowError QErr arr => arr (e, s) a -> arr (e, (JSONPathElement, s)) a
- withPathKA :: ArrowError QErr arr => arr (e, s) a -> arr (e, (Text, s)) a
- withPathK :: QErrM m => Text -> m a -> m a
- withPathIA :: ArrowError QErr arr => arr (e, s) a -> arr (e, (Int, s)) a
- withPathI :: QErrM m => Int -> m a -> m a
- indexedFoldlA' :: (ArrowChoice arr, ArrowError QErr arr, Foldable t) => arr (e, (b, (a, s))) b -> arr (e, (b, (t a, s))) b
- indexedTraverseA_ :: (ArrowChoice arr, ArrowError QErr arr, Foldable t) => arr (e, (a, s)) b -> arr (e, (t a, s)) ()
- indexedMapM_ :: (QErrM m, Foldable t) => (a -> m b) -> t a -> m ()
- indexedForM_ :: (QErrM m, Foldable t) => t a -> (a -> m b) -> m ()
- indexedMapM :: QErrM m => (a -> m b) -> [a] -> m [b]
- indexedForM :: QErrM m => [a] -> (a -> m b) -> m [b]
- liftIResult :: QErrM m => IResult a -> m a
- iResultToMaybe :: IResult a -> Maybe a
- formatMsg :: String -> String
- runAesonParser :: QErrM m => (v -> Parser a) -> v -> m a
- decodeValue :: (FromJSON a, QErrM m) => Value -> m a
Documentation
Instances
Eq Code Source # | |
Show Code Source # | |
ToJSON Code Source # | |
Defined in Hasura.Base.Error |
Instances
Extra context for a QErr, which can either be information from an internal
error (e.g. from Postgres, or from a network operation timing out), or
context provided when an external service or operation fails, for instance, a
webhook error response may provide additional context in the extensions
key.
ExtraExtensions Value | |
ExtraInternal Value |
Instances
Eq QErrExtra Source # | |
ToJSON QErrExtra Source # | |
Defined in Hasura.Base.Error toEncoding :: QErrExtra -> Encoding toJSONList :: [QErrExtra] -> Value toEncodingList :: [QErrExtra] -> Encoding |
overrideQErrStatus :: Status -> Code -> QErr -> QErr Source #
Overrides the status and code of a QErr while retaining all other fields.
prefixQErr :: Text -> QErr -> QErr Source #
Prefixes the message of a QErr while retaining all other fields.
noInternalQErrEnc :: QErr -> Value Source #
encodeGQLErr :: Bool -> QErr -> Value Source #
encodeQErr :: Bool -> QErr -> Value Source #
type QErrM m = MonadError QErr m Source #
internalError :: Text -> QErr Source #
throw500WithDetail :: QErrM m => Text -> Value -> m a Source #
modifyErrA :: ArrowError QErr arr => arr (e, s) a -> arr (e, (Text -> Text, s)) a Source #
liftTxtMod :: (Text -> Text) -> QErr -> QErr Source #
modifyErrAndSet500 :: QErrM m => (Text -> Text) -> m a -> m a Source #
liftTxtMod500 :: (Text -> Text) -> QErr -> QErr Source #
withPathE :: ArrowError QErr arr => arr (e, s) a -> arr (e, (JSONPathElement, s)) a Source #
withPathKA :: ArrowError QErr arr => arr (e, s) a -> arr (e, (Text, s)) a Source #
withPathIA :: ArrowError QErr arr => arr (e, s) a -> arr (e, (Int, s)) a Source #
indexedFoldlA' :: (ArrowChoice arr, ArrowError QErr arr, Foldable t) => arr (e, (b, (a, s))) b -> arr (e, (b, (t a, s))) b Source #
indexedTraverseA_ :: (ArrowChoice arr, ArrowError QErr arr, Foldable t) => arr (e, (a, s)) b -> arr (e, (t a, s)) () Source #
indexedMapM_ :: (QErrM m, Foldable t) => (a -> m b) -> t a -> m () Source #
indexedForM_ :: (QErrM m, Foldable t) => t a -> (a -> m b) -> m () Source #
indexedMapM :: QErrM m => (a -> m b) -> [a] -> m [b] Source #
indexedForM :: QErrM m => [a] -> (a -> m b) -> m [b] Source #
liftIResult :: QErrM m => IResult a -> m a Source #
iResultToMaybe :: IResult a -> Maybe a Source #
runAesonParser :: QErrM m => (v -> Parser a) -> v -> m a Source #
decodeValue :: (FromJSON a, QErrM m) => Value -> m a Source #