| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Mafoc.Exceptions
Synopsis
- newtype Showing a = Showing a
- data MafocIOException
- = Can't_deserialise_LedgerState_from_CBOR FilePath DeserialiseFailure
- | Can't_parse_chain_point_from_LedgerState_file_name FilePath String
- | The_impossible_happened {
- whatItWas :: Text
- | SlotNo_not_found SlotNo
- | No_headerDb_specified
- | Can't_find_previous_ChainPoint_to_slot SlotNo
- | ChainPoints_don't_match [(String, Maybe ChainPoint)]
- | RTS_GC_stats_not_enabled
- | Indexer_has_no_HTTP_API
- | TextException Text
- data CardanoAssumptionBroken
- = Epoch_difference_other_than_0_or_1 {
- epochNo :: EpochNo
- followingEpochNo :: EpochNo
- | Epoch_number_disappears {
- previouslyExistingEpochNo :: EpochNo
- | UTxO_not_found {
- attemptedToSpend :: TxIn
- slotNo :: SlotNo
- bhh :: Hash BlockHeader
- | Block_number_ahead_of_tip {
- blockNumberInBlock :: BlockNo
- blockNumberInChainTip :: ChainTip
- = Epoch_difference_other_than_0_or_1 {
- throwShow :: Show a => a -> IO b
- throw :: forall (r :: RuntimeRep) (a :: TYPE r) e. Exception e => e -> a
- throwIO :: Exception e => e -> IO a
Documentation
Constructors
| Showing a |
Instances
| Show a => Pretty (Showing a) # | |
Defined in Mafoc.Exceptions | |
data MafocIOException #
Constructors
| Can't_deserialise_LedgerState_from_CBOR FilePath DeserialiseFailure | |
| Can't_parse_chain_point_from_LedgerState_file_name FilePath String | |
| The_impossible_happened | Impossible |
Fields
| |
| SlotNo_not_found SlotNo | Header-DB |
| No_headerDb_specified | |
| Can't_find_previous_ChainPoint_to_slot SlotNo | |
| ChainPoints_don't_match [(String, Maybe ChainPoint)] | ChainPoints from multiple state sources |
| RTS_GC_stats_not_enabled | GHC.Stats.getRTSStats: GC stats not enabled. Use `+RTS -T -RTS' to enable them. |
| Indexer_has_no_HTTP_API | An escape-hatch exception: an exception where we don't bother with structure, but just explain in text. Perhaps we'll find a category later. |
| TextException Text | |
Instances
| Exception MafocIOException # | |
Defined in Mafoc.Exceptions Methods toException :: MafocIOException -> SomeException # | |
| Show MafocIOException # | |
Defined in Mafoc.Exceptions Methods showsPrec :: Int -> MafocIOException -> ShowS # show :: MafocIOException -> String # showList :: [MafocIOException] -> ShowS # | |
| Pretty MafocIOException # | |
Defined in Mafoc.Exceptions | |
data CardanoAssumptionBroken #
Constructors
| Epoch_difference_other_than_0_or_1 | |
Fields
| |
| Epoch_number_disappears | |
Fields
| |
| UTxO_not_found | |
Fields
| |
| Block_number_ahead_of_tip | |
Fields
| |
Instances
| Exception CardanoAssumptionBroken # | |
Defined in Mafoc.Exceptions | |
| Show CardanoAssumptionBroken # | |
Defined in Mafoc.Exceptions Methods showsPrec :: Int -> CardanoAssumptionBroken -> ShowS # show :: CardanoAssumptionBroken -> String # showList :: [CardanoAssumptionBroken] -> ShowS # | |
| Pretty CardanoAssumptionBroken # | |
Defined in Mafoc.Exceptions Methods pretty :: CardanoAssumptionBroken -> Doc ann prettyList :: [CardanoAssumptionBroken] -> Doc ann | |
throw :: forall (r :: RuntimeRep) (a :: TYPE r) e. Exception e => e -> a #
Throw an exception. Exceptions may be thrown from purely
functional code, but may only be caught within the IO monad.
throwIO :: Exception e => e -> IO a #
A variant of throw that can only be used within the IO monad.
Although throwIO has a type that is an instance of the type of throw, the
two functions are subtly different:
throw e `seq` x ===> throw e throwIO e `seq` x ===> x
The first example will cause the exception e to be raised,
whereas the second one won't. In fact, throwIO will only cause
an exception to be raised when it is used within the IO monad.
The throwIO variant should be used in preference to throw to
raise an exception within the IO monad because it guarantees
ordering with respect to other IO operations, whereas throw
does not.