Skip to content

Commit c14e4d5

Browse files
=targos
=
authored andcommitted
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: #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>
1 parent 0856a4d commit c14e4d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/parallel/test-process-uid-gid.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const oldgid = process.getgid();
7474
try {
7575
process.setgid('nobody');
7676
} catch (err) {
77-
if (err.message !== 'setgid group id does not exist') {
77+
if (err.code !== 'ERR_UNKNOWN_CREDENTIAL') {
7878
throw err;
7979
}
8080
process.setgid('nogroup');

0 commit comments

Comments
 (0)