Skip to content

Remove throws from getPort #171

@MasterOdin

Description

@MasterOdin

When passing certain invalid option configurations to getPort, the function will throw:

if(!options.startPort) {
options.startPort = Number(options.port);
if(options.startPort < 0) {
throw Error('Provided options.startPort(' + options.startPort + ') is less than 0, which are cannot be bound.');
}
if(options.stopPort < options.startPort) {
throw Error('Provided options.stopPort(' + options.stopPort + 'is less than options.startPort (' + options.startPort + ')');
}
}

Given the callback nature of usage, I think it'd make more sense to just return an error on the callback vs throwing an error.

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