@@ -72,7 +72,9 @@ static void GetHostname(const FunctionCallbackInfo<Value>& args) {
72
72
#else // __MINGW32__
73
73
int errorno = WSAGetLastError ();
74
74
#endif // __POSIX__
75
- return env->ThrowErrnoException (errorno, " gethostname" );
75
+ CHECK_GE (args.Length (), 1 );
76
+ env->CollectExceptionInfo (args[args.Length () - 1 ], errorno, " gethostname" );
77
+ return args.GetReturnValue ().SetUndefined ();
76
78
}
77
79
buf[sizeof (buf) - 1 ] = ' \0 ' ;
78
80
@@ -87,7 +89,9 @@ static void GetOSType(const FunctionCallbackInfo<Value>& args) {
87
89
#ifdef __POSIX__
88
90
struct utsname info;
89
91
if (uname (&info) < 0 ) {
90
- return env->ThrowErrnoException (errno, " uname" );
92
+ CHECK_GE (args.Length (), 1 );
93
+ env->CollectExceptionInfo (args[args.Length () - 1 ], errno, " uname" );
94
+ return args.GetReturnValue ().SetUndefined ();
91
95
}
92
96
rval = info.sysname ;
93
97
#else // __MINGW32__
@@ -105,7 +109,9 @@ static void GetOSRelease(const FunctionCallbackInfo<Value>& args) {
105
109
#ifdef __POSIX__
106
110
struct utsname info;
107
111
if (uname (&info) < 0 ) {
108
- return env->ThrowErrnoException (errno, " uname" );
112
+ CHECK_GE (args.Length (), 1 );
113
+ env->CollectExceptionInfo (args[args.Length () - 1 ], errno, " uname" );
114
+ return args.GetReturnValue ().SetUndefined ();
109
115
}
110
116
# ifdef _AIX
111
117
char release[256 ];
@@ -242,7 +248,10 @@ static void GetInterfaceAddresses(const FunctionCallbackInfo<Value>& args) {
242
248
if (err == UV_ENOSYS) {
243
249
return args.GetReturnValue ().Set (ret);
244
250
} else if (err) {
245
- return env->ThrowUVException (err, " uv_interface_addresses" );
251
+ CHECK_GE (args.Length (), 1 );
252
+ env->CollectUVExceptionInfo (args[args.Length () - 1 ], errno,
253
+ " uv_interface_addresses" );
254
+ return args.GetReturnValue ().SetUndefined ();
246
255
}
247
256
248
257
for (i = 0 ; i < count; i++) {
@@ -319,7 +328,9 @@ static void GetHomeDirectory(const FunctionCallbackInfo<Value>& args) {
319
328
const int err = uv_os_homedir (buf, &len);
320
329
321
330
if (err) {
322
- return env->ThrowUVException (err, " uv_os_homedir" );
331
+ CHECK_GE (args.Length (), 1 );
332
+ env->CollectUVExceptionInfo (args[args.Length () - 1 ], err, " uv_os_homedir" );
333
+ return args.GetReturnValue ().SetUndefined ();
323
334
}
324
335
325
336
Local<String> home = String::NewFromUtf8 (env->isolate (),
@@ -351,7 +362,10 @@ static void GetUserInfo(const FunctionCallbackInfo<Value>& args) {
351
362
const int err = uv_os_get_passwd (&pwd);
352
363
353
364
if (err) {
354
- return env->ThrowUVException (err, " uv_os_get_passwd" );
365
+ CHECK_GE (args.Length (), 2 );
366
+ env->CollectUVExceptionInfo (args[args.Length () - 1 ], err,
367
+ " uv_os_get_passwd" );
368
+ return args.GetReturnValue ().SetUndefined ();
355
369
}
356
370
357
371
Local<Value> error;
0 commit comments