-
Notifications
You must be signed in to change notification settings - Fork 99
Closed
Description
When passing certain invalid option configurations to getPort, the function will throw:
node-portfinder/lib/portfinder.js
Lines 136 to 144 in 724a0e1
| 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
Labels
No labels