Skip to content

Errors in some APIs can't be handled #42

@cprussin

Description

@cprussin

For example, in Node.FS.Stream, createReadStream has the type:

createReadStream :: FilePath -> Effect (Readable ())

But the Node API can raise an exception, for instance, if the file doesn't exists. Likely the type should be:

createReadStream :: FilePath -> Effect (Either Error (Readable ()))

Is there any other solution that would be preferred here over catching the exception and returning an Either?

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