+
Skip to content

Reject with error on http server error #256

@xyc

Description

@xyc

Use case: When the port is already in use (for example in 9856), the library throws an uncaughtException. This prevents the upstream consumer from further handling the error.

Proposed fix is to add following error handler after

reload/lib/reload.js

Lines 168 to 170 in c0271a6

httpOrHttpsServer.listen(port, function () {
resolve(getReloadReturn())
})

httpOrHttpsServer.on('error', function(error) {
    reject(error);
});

Reference:
https://stackoverflow.com/a/14470248

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载