Safe Haskell | None |
---|---|
Language | Haskell2010 |
Advanced errors.
Synopsis
- type IsError err = (IsoValue err, KnownValue err, NoOperation err, NoBigMap err)
- type LorentzUserError e = (ErrorTag, e)
- unLorentzUserError :: LorentzUserError e -> e
- type UserFailInstr e name s s' = (InstrWrapC e name, KnownSymbol name) => Label name -> AppendCtorField (GetCtorField e name) s :-> s'
- userFailWith :: forall err name s s'. (Typeable (ToT err), SingI (ToT err)) => UserFailInstr err name s s'
Documentation
type IsError err = (IsoValue err, KnownValue err, NoOperation err, NoBigMap err) Source #
Constraints on an object you can fail with.
type LorentzUserError e = (ErrorTag, e) Source #
An error indicating a normal failure caused by such user input.
unLorentzUserError :: LorentzUserError e -> e Source #
Pseudo-getter for error within LorentzUserError
.
type UserFailInstr e name s s' = (InstrWrapC e name, KnownSymbol name) => Label name -> AppendCtorField (GetCtorField e name) s :-> s' Source #
Signature of userFailWith
.
userFailWith :: forall err name s s'. (Typeable (ToT err), SingI (ToT err)) => UserFailInstr err name s s' Source #
Fail with given error, picking argument for error from the top
of the stack if any required. Error will be wrapped into LorentzUserError
(i.e. an error tag will be attached to the error data).
Consider the following practice: once error datatype for your contract is defined, create a specialization of this function to the error type.