这是indexloc提供的服务,不要输入任何密码
Skip to content

unhandled error when a file does not exists #1

@jguillod

Description

@jguillod

I got the following error with Node aborting when trying to response.zip() an unexisting file path:

events.js:71
        throw arguments[1]; // Unhandled 'error' event
                       ^
Error: ENOENT, open '/Some/Path/to/null/file'

This exits Node even if we call the response.zip() function inside a try... catch... statment.

Could you deal with it by calling the error callback or some other way in order not to abort the Node server?

Of course I will test the file existance with fs.existsSync()

Thanks a lot for this easy to use module!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions