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 <vieuxtech@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
  • Loading branch information
= authored and targos committed Jul 2, 2019
1 parent 0856a4d commit c14e4d5
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 c14e4d5

Please sign in to comment.