Skip to content
Prev Previous commit
Next Next commit
errors: update bootstrap_node.js to use internal/errors
  • Loading branch information
jasnell committed Oct 25, 2016
commit 9bbef400928cc7159d019b92399671975eec44cf
3 changes: 2 additions & 1 deletion lib/internal/bootstrap_node.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,8 @@
}

if (!NativeModule.exists(id)) {
throw new Error(`No such native module ${id}`);
const errors = require('internal/errors');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: const {Error} = require('internal/errors');

throw new errors.Error('NATIVE_MODULE_NOT_FOUND', id);
}

process.moduleLoadList.push(`NativeModule ${id}`);
Expand Down
1 change: 1 addition & 0 deletions lib/internal/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,4 @@ function E(sym, val) {

// Note: Please try to keep these in alphabetical order
E('ASSERTION_ERROR', (msg) => msg);
E('NATIVE_MODULE_NOT_FOUND', (module) => `No such native module ${module}`);