-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
conway governance hash: Correct/introduce error handling
- Loading branch information
Showing
2 changed files
with
11 additions
and
7 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
10 changes: 6 additions & 4 deletions
10
cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceHashError.hs
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 |
---|---|---|
@@ -1,15 +1,17 @@ | ||
{-# LANGUAGE LambdaCase #-} | ||
module Cardano.CLI.Types.Errors.GovernanceHashError | ||
( GovernanceHashError(..) | ||
) where | ||
|
||
import Cardano.Api | ||
|
||
import Cardano.Prelude (UnicodeException) | ||
import Cardano.Prelude (Exception (displayException), IOException) | ||
|
||
data GovernanceHashError | ||
= GovernanceHashReadFileError (FileError InputDecodeError) | ||
| GovernanceHashUnicodeError UnicodeException | ||
= GovernanceHashReadFileError FilePath IOException | ||
deriving Show | ||
|
||
instance Error GovernanceHashError where | ||
displayError = undefined | ||
displayError = \case | ||
GovernanceHashReadFileError filepath exc -> | ||
"Cannot read " <> filepath <> ": " <> displayException exc |