lorentz-0.6.1: EDSL for the Michelson Language
Safe HaskellNone
LanguageHaskell2010

Lorentz.Errors.Numeric.Doc

Contents

Description

Autodoc for numeric errors.

Synopsis

Documentation

data DDescribeErrorTagMap Source #

Adds a section which explains error tag mapping.

Constructors

DDescribeErrorTagMap 

Fields

  • detmSrcLoc :: Text

    Describes where the error tag map is defined in Haskell code.

Instances

Instances details
Eq DDescribeErrorTagMap Source # 
Instance details

Defined in Lorentz.Errors.Numeric.Doc

Ord DDescribeErrorTagMap Source # 
Instance details

Defined in Lorentz.Errors.Numeric.Doc

DocItem DDescribeErrorTagMap Source # 
Instance details

Defined in Lorentz.Errors.Numeric.Doc

type DocItemPlacement DDescribeErrorTagMap Source # 
Instance details

Defined in Lorentz.Errors.Numeric.Doc

type DocItemReferenced DDescribeErrorTagMap Source # 
Instance details

Defined in Lorentz.Errors.Numeric.Doc

applyErrorTagToErrorsDoc :: HasCallStack => ErrorTagMap -> (inp :-> out) -> inp :-> out Source #

Modify documentation generated for given code so that all CustomError mention not their textual error tag rather respective numeric one from the given map.

If some documented error is not present in the map, it remains unmodified. This function may fail with error if contract uses some uncommon errors, see applyErrorTagToErrorsDocWith for details.

applyErrorTagToErrorsDocWith :: HasCallStack => [NumericErrorDocHandler] -> ErrorTagMap -> (inp :-> out) -> inp :-> out Source #

Extended version of applyErrorTagToErrorsDoc which accepts error handlers.

In most cases that function should be enough for your purposes, but it uses a fixed set of base handlers which may be not enough in case when you define your own errors. In this case define and pass all the necessary handlers to this function.

It fails with error if some of the errors used in the contract cannot be handled with given handlers.

data NumericErrorDocHandler Source #

Handler which changes documentation for one particular error type.

baseErrorDocHandlers :: [NumericErrorDocHandler] Source #

Handlers for most common errors defined in Lorentz.

Internals

data NumericErrorWrapper (numTag :: Nat) (err :: Type) Source #

Some error with a numeric tag attached.