forked from IntersectMBO/cardano-addresses
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use MonadThrow for inspecting addresses
Wrt IntersectMBO#46. Easier tracing of error causes.
- Loading branch information
Showing
11 changed files
with
171 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{-# LANGUAGE ExistentialQuantification #-} | ||
{-# LANGUAGE StandaloneDeriving #-} | ||
|
||
-- | | ||
-- Copyright: © 2020 IOHK | ||
-- License: Apache-2.0 | ||
|
||
module Cardano.Address.Errors | ||
( -- $overview | ||
|
||
-- * AddrError | ||
ShelleyAddrError(..) | ||
, ByronAddrError(..) | ||
, IcarusAddrError(..) | ||
, JormungandrAddrError(..) | ||
) where | ||
|
||
import Prelude | ||
|
||
import Control.Exception | ||
( Exception ) | ||
|
||
-- $overview | ||
-- | ||
-- This module provides error/exception types for Addresses. | ||
|
||
data ShelleyAddrError | ||
= ShUnknownAddrType | ||
| ShWrongInputSize Int -- the actual size | ||
| ShPtrRetrieveError String -- human readable error of underlying operation | ||
|
||
deriving instance Show ShelleyAddrError | ||
|
||
instance Exception ShelleyAddrError | ||
|
||
|
||
data ByronAddrError | ||
= BrInvalidDerivationPath | ||
| forall e . (Exception e, Show e) => BrDeserialiseError e | ||
|
||
deriving instance Show ByronAddrError | ||
|
||
instance Exception ByronAddrError | ||
|
||
|
||
data IcarusAddrError | ||
= IcInvalidDerivationPath | ||
| forall e . (Exception e, Show e) => IcDeserialiseError e | ||
|
||
deriving instance Show IcarusAddrError | ||
|
||
instance Exception IcarusAddrError | ||
|
||
|
||
data JormungandrAddrError | ||
= JoUnknownAddrType | ||
| JoWrongInputSize Int -- the actual size | ||
|
||
deriving instance Show JormungandrAddrError | ||
|
||
instance Exception JormungandrAddrError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.