Skip to content

Writing can raise Failure _ #78

@reynir

Description

@reynir

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions