plutus-use-cases-1.2.0.0: Collection of smart contracts to develop the plutus/wallet interface
Safe HaskellNone
LanguageHaskell2010

Plutus.Contracts.ErrorHandling

Synopsis

Documentation

type Schema = (Endpoint "throwError" () .\/ Endpoint "catchError" ()) .\/ Endpoint "catchContractError" () Source #

data MyError Source #

MyError has a constructor for each type of error that our contract can throw. The MyContractError constructor wraps a ContractError.

Constructors

Error1 Text 
Error2 
MyContractError ContractError 

Instances

Instances details
Show MyError Source # 
Instance details

Defined in Plutus.Contracts.ErrorHandling

Generic MyError Source # 
Instance details

Defined in Plutus.Contracts.ErrorHandling

Associated Types

type Rep MyError :: Type -> Type Source #

FromJSON MyError Source # 
Instance details

Defined in Plutus.Contracts.ErrorHandling

Methods

parseJSON :: Value -> Parser MyError

parseJSONList :: Value -> Parser [MyError]

ToJSON MyError Source # 
Instance details

Defined in Plutus.Contracts.ErrorHandling

Methods

toJSON :: MyError -> Value

toEncoding :: MyError -> Encoding

toJSONList :: [MyError] -> Value

toEncodingList :: [MyError] -> Encoding

AsContractError MyError Source # 
Instance details

Defined in Plutus.Contracts.ErrorHandling

Methods

_ContractError :: Prism' MyError ContractError

_WalletContractError :: Prism' MyError WalletAPIError

_ChainIndexContractError :: Prism' MyError (Text, ChainIndexResponse)

_ConstraintResolutionContractError :: Prism' MyError MkTxError

_ToCardanoConvertContractError :: Prism' MyError ToCardanoError

_ResumableContractError :: Prism' MyError MatchingError

_CCheckpointContractError :: Prism' MyError CheckpointError

_EndpointDecodeContractError :: Prism' MyError (EndpointDescription, EndpointValue Value, Text)

_OtherContractError :: Prism' MyError Text

AsMyError MyError Source # 
Instance details

Defined in Plutus.Contracts.ErrorHandling

Methods

_MyError :: Prism' MyError MyError Source #

_Error1 :: Prism' MyError Text Source #

_Error2 :: Prism' MyError () Source #

_MyContractError :: Prism' MyError ContractError Source #

type Rep MyError Source # 
Instance details

Defined in Plutus.Contracts.ErrorHandling

type Rep MyError = D1 ('MetaData "MyError" "Plutus.Contracts.ErrorHandling" "plutus-use-cases-1.2.0.0-BuYOLXrynPcLosE012cowc" 'False) (C1 ('MetaCons "Error1" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: (C1 ('MetaCons "Error2" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MyContractError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ContractError))))

class AsMyError r where Source #

Minimal complete definition

_MyError

Methods

_MyError :: Prism' r MyError Source #

_Error1 :: Prism' r Text Source #

_Error2 :: Prism' r () Source #

_MyContractError :: Prism' r ContractError Source #

Instances

Instances details
AsMyError MyError Source # 
Instance details

Defined in Plutus.Contracts.ErrorHandling

Methods

_MyError :: Prism' MyError MyError Source #

_Error1 :: Prism' MyError Text Source #

_Error2 :: Prism' MyError () Source #

_MyContractError :: Prism' MyError ContractError Source #

contract :: (AsMyError e, AsContractError e) => SlotConfig -> Contract w Schema e () Source #