diff options
author | = <=> | 2019-06-13 17:14:33 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-06-20 11:02:16 -0600 |
commit | e57bf473517f12eb169e960aa80ffd5dcd5994d5 (patch) | |
tree | b09766db90849042edec94f896247438c216fc82 /test/parallel/test-process-uid-gid.js | |
parent | b0f75818f39ed4e6bd80eb7c4010c1daf5823ef7 (diff) | |
download | android-node-v8-e57bf473517f12eb169e960aa80ffd5dcd5994d5.tar.gz android-node-v8-e57bf473517f12eb169e960aa80ffd5dcd5994d5.tar.bz2 android-node-v8-e57bf473517f12eb169e960aa80ffd5dcd5994d5.zip |
test: use .code for error in setgid
When the 'nobody' user is missing use .code to detect this, its more
robust than than the .message string.
Refs: https://github.com/nodejs/node/issues/19594
PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'test/parallel/test-process-uid-gid.js')
-rw-r--r-- | test/parallel/test-process-uid-gid.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/parallel/test-process-uid-gid.js b/test/parallel/test-process-uid-gid.js index 49086792b9..dd11a2ec6e 100644 --- a/test/parallel/test-process-uid-gid.js +++ b/test/parallel/test-process-uid-gid.js @@ -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'); |