Skip to content
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

Writing can raise Failure _ #78

Open
reynir opened this issue Jan 27, 2023 · 0 comments
Open

Writing can raise Failure _ #78

reynir opened this issue Jan 27, 2023 · 0 comments

Comments

@reynir
Copy link

reynir commented Jan 27, 2023

When writing to a closed Faraday.t an exception Failure "cannot write to closed writer" is raised. I am observing this exception from Httpaf.Body.write_string, and I'm wary of catching all Failures. Could a more precise exception be used?

faraday/lib/faraday.ml

Lines 193 to 195 in c66fc02

let writable_exn t =
if t.closed then
failwith "cannot write to closed writer"

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

No branches or pull requests

1 participant