Skip to content

Conversation

@szg251
Copy link
Collaborator

@szg251 szg251 commented Feb 11, 2022

Solves: #45

@szg251 szg251 force-pushed the gergely/error-handling branch from 63501a0 to 7990706 Compare February 11, 2022 08:10
, networkOpt pabConf
]
)
( ( \out ->
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realised that the callCommand will throw an IOErr exception when fails, so parsing the output is unnecessary, it's enough to know that the exitcode is 0

@szg251 szg251 requested a review from mikekeke February 11, 2022 10:48
fileWriteRes <-
Files.writeAll @w contractEnv.cePABConfig tx
eitherT (pure . WriteBalancedTxFailed . OtherError) (pure . WriteBalancedTxSuccess . Right) $ do
void $ firstEitherT (Text.pack . show) $ newEitherT $ Files.writeAll @w contractEnv.cePABConfig tx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Theres a lot going on here, but I can't think of a way to simplify when using EitherT :(

@szg251 szg251 merged commit 9cf0c14 into master Feb 11, 2022
@szg251 szg251 deleted the gergely/error-handling branch February 11, 2022 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants