Skip to content

Commit

Permalink
report: refactor argument validation
Browse files Browse the repository at this point in the history
PR-URL: #26276
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
cjihrig authored and addaleax committed Mar 1, 2019
1 parent 33fe892 commit 6d2a14d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/internal/process/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ const report = {
},
getReport(err) {
emitExperimentalWarning('report');
if (err == null) {
return nr.getReport(new ERR_SYNTHETIC().stack);
} else if (typeof err !== 'object') {

if (err === undefined)
err = new ERR_SYNTHETIC();
else if (err === null || typeof err !== 'object')
throw new ERR_INVALID_ARG_TYPE('err', 'Object', err);
} else {
return nr.getReport(err.stack);
}

return nr.getReport(err.stack);
}
};

Expand Down

0 comments on commit 6d2a14d

Please sign in to comment.