Skip to content

Commit

Permalink
Error instance for FileError instead of Pretty
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Nov 17, 2023
1 parent b801e3b commit 550e38c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cardano-api/internal/Cardano/Api/Error.hs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ data FileError e = FileError FilePath e
| FileIOError FilePath IOException
deriving (Show, Eq, Functor)

instance Error e => Pretty (FileError e) where
pretty = \case
instance Error e => Error (FileError e) where
prettyError = \case
FileErrorTempFile targetPath tempPath h ->
vsep
[ "Error creating temporary file at: " <> pretty tempPath
Expand Down
2 changes: 1 addition & 1 deletion cardano-api/test/cardano-api-test/Test/Cardano/Api/IO.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ prop_createVrfFileWithOwnerPermissions =
result <- liftIO $ writeLazyByteStringFileWithOwnerPermissions (File file) ""

case result of
Left err -> failWith Nothing $ prettyToString $ pretty @(FileError ()) err
Left err -> failWith Nothing $ prettyToString $ prettyError @(FileError ()) err
Right () -> return ()

fResult <- liftIO . runExceptT $ checkVrfFilePermissions (File file)
Expand Down

0 comments on commit 550e38c

Please sign in to comment.