Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class ToHumanFriendlyError e where
- mkHumanFriendly :: e -> Text
- newtype HumanFriendlyErrorText = UnsafeMkHumanFriendlyErrorText {}
Documentation
class ToHumanFriendlyError e where #
This class represents the concept of "human friendly strings", by which we mean error messages and/or diagnostics which needs to be displayed to the end users, and, as such:
- They should be easy to understand for end users, not developers (developers would access the full debug logs on the server machine). As such, they don't have to include implementation details and/or technicalities;
- They MUST NOT include any sensitive data. Please be very careful when writing these instances
because just calling "T.pack . show" on the input data is immediately wrong; things like Servant's
ClientError
or any HTTP exception might include api keys in the form of HTTP headers, so leaking that is BAD.
mkHumanFriendly :: e -> Text #
Instances
ToHumanFriendlyError Void # | |
Defined in Gargantext.Utils.Jobs.Error mkHumanFriendly :: Void -> Text # | |
ToHumanFriendlyError GetCorpusError # | |
Defined in Gargantext.Core.Text.Corpus.API mkHumanFriendly :: GetCorpusError -> Text # | |
ToHumanFriendlyError ParseFormatError # | |
Defined in Gargantext.Core.Text.Corpus.Parsers mkHumanFriendly :: ParseFormatError -> Text # | |
ToHumanFriendlyError HumanFriendlyErrorText # | |
Defined in Gargantext.Utils.Jobs.Error |
newtype HumanFriendlyErrorText #
A newtype to wrap a Text
to be displayed to the end user.
IMPORTANT: You need to be very careful when using this newtype; please ensure that the text
you are wrapping with this newtype doesn't contain sentitive information.