-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ExitCodeException
smart constructors
#80
Add ExitCodeException
smart constructors
#80
Conversation
b1f0ff3
to
2fc9f75
Compare
I'm pretty confused about this. Is it correct that prior to this MR that when What is the point of those fields then? And what's the use case for populating them? |
This may need @snoyberg to opine. |
Ah, I got this wrong — documentation on which functions include stdout/stderr was actually added by my CTO in #22! I didn't notice because it uses the record update syntax so my grep didn't turn it up: typed-process/src/System/Process/Typed.hs Lines 432 to 435 in d5e9fb3
|
2fc9f75
to
316bedc
Compare
Please rebase on |
`ExitCodeException`s thrown by `typed-process` never populate the `eceStdout` or `eceStderr` fields, and it's impossible to construct an `ExitCodeException` manually because the `pConfig` field accessor is not public. This patch adds two smart constructors, `exitCodeExceptionWithOutput` and `exitCodeExceptionNoOutput`, to fill these use cases.
This enables third-parties to construct their own `ExitCodeException`s from `Process` values.
316bedc
to
c4505b1
Compare
Done, PTAL |
I'll have to defer to @snoyberg on this. I don't really understand the possible consequences. |
I don't see anything concerning here myself. No objection to a merge, is there something in particular you were concerned with @tomjaguarpaw? |
I didn't feel comfortable approving myself because I'm not familiar with runProcessExitCodeException :: MonadIO m => ProcessConfig stdin stdout stderr -> m ExitCodeException as a counterpart to Anyway, if you're happy with it then let's go ahead and merge. |
This has been released in https://hackage.haskell.org/package/typed-process-0.2.12.0 |
It's impossible to construct an
ExitCodeException
manually because thepConfig
field accessor is not public. This patch adds two smart constructors,exitCodeExceptionWithOutput
andexitCodeExceptionNoOutput
, to fill this use cases.