| Copyright | Flipstone Technology Partners 2023 |
|---|---|
| License | MIT |
| Stability | Stable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Orville.PostgreSQL.Marshall.MarshallError
Description
Since: 1.0.0.0
Synopsis
- data MarshallError = MarshallError {}
- renderMarshallError :: ErrorDetailLevel -> MarshallError -> String
- data MarshallErrorDetails
- renderMarshallErrorDetails :: ErrorDetailLevel -> MarshallErrorDetails -> String
- data DecodingErrorDetails = DecodingErrorDetails {}
- renderDecodingErrorDetails :: ErrorDetailLevel -> DecodingErrorDetails -> String
- data MissingColumnErrorDetails = MissingColumnErrorDetails {}
- renderMissingColumnErrorDetails :: ErrorDetailLevel -> MissingColumnErrorDetails -> String
Documentation
data MarshallError Source #
A MarshallError may be returned from
marshallResultFromSql when a row being decoded
from the database doesn't meet the expectations of the
SqlMarshaller that is decoding it.
Since: 1.0.0.0
Constructors
| MarshallError | |
Fields
| |
Instances
| Exception MarshallError Source # | |
Defined in Orville.PostgreSQL.Marshall.MarshallError Methods toException :: MarshallError -> SomeException # fromException :: SomeException -> Maybe MarshallError # displayException :: MarshallError -> String # | |
| Show MarshallError Source # | |
Defined in Orville.PostgreSQL.Marshall.MarshallError Methods showsPrec :: Int -> MarshallError -> ShowS # show :: MarshallError -> String # showList :: [MarshallError] -> ShowS # | |
renderMarshallError :: ErrorDetailLevel -> MarshallError -> String Source #
Renders a MarshallError to a string using the specified ErrorDetailLevel.
This ignores any ErrorDetailLevel that was captured by default from
the Orville context and uses the specified level of detail instead.
You may want to use this function to render certain errors with a higher
level of detail than you consider safe for (for example) your application
logs while using a lower default error detail level with the Show instance
of MarshallError in case an exception is handled in a more visible section
of code that returns information more publicly (e.g. a request handler for a
public endpoint).
Since: 1.0.0.0
data MarshallErrorDetails Source #
A MarshallErrorDetails may be returned from
marshallResultFromSql if the result set being
decoded from the database doesn't meet the expectations of the
SqlMarshaller that is decoding it.
Since: 1.0.0.0
Constructors
| DecodingError DecodingErrorDetails | Indicates that one or more values in a column could not be decoded, either individually or as a group. |
| MissingColumnError MissingColumnErrorDetails | Indicates that an expected column was not found in the result set. |
renderMarshallErrorDetails :: ErrorDetailLevel -> MarshallErrorDetails -> String Source #
Renders a MarshallErrorDetails to a String with a specified
ErrorDetailLevel.
Since: 1.0.0.0
data DecodingErrorDetails Source #
Details about an error that occurred while decoding values found in a SQL result set.
Since: 1.0.0.0
Constructors
| DecodingErrorDetails | |
Fields | |
renderDecodingErrorDetails :: ErrorDetailLevel -> DecodingErrorDetails -> String Source #
Renders a DecodingErrorDetails to a String with a specified
ErrorDetailLevel.
Since: 1.0.0.0
data MissingColumnErrorDetails Source #
Details about a column that was found to be missing in a SQL result set during decoding.
Since: 1.0.0.0
Constructors
| MissingColumnErrorDetails | |
Fields | |
renderMissingColumnErrorDetails :: ErrorDetailLevel -> MissingColumnErrorDetails -> String Source #
Renders a MissingColumnErrorDetails to a String with a specified
ErrorDetailLevel.
Since: 1.0.0.0