Skip to content

Commit

Permalink
test: use .code for error in setgid
Browse files Browse the repository at this point in the history
When the 'nobody' user is missing use .code to detect this, its more
robust than than the .message string.

Refs: #19594

PR-URL: #28219
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Yongsheng Zhang <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
Reviewed-By: Anto Aravinth <[email protected]>
  • Loading branch information
= authored and Trott committed Jun 20, 2019
1 parent b0f7581 commit e57bf47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/parallel/test-process-uid-gid.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const oldgid = process.getgid();
try {
process.setgid('nobody');
} catch (err) {
if (err.message !== 'setgid group id does not exist') {
if (err.code !== 'ERR_UNKNOWN_CREDENTIAL') {
throw err;
}
process.setgid('nogroup');
Expand Down

0 comments on commit e57bf47

Please sign in to comment.