cleanup error message

This commit is contained in:
Jarred Sumner
2023-01-17 16:47:45 -08:00
parent fd0edd7aa0
commit 9e403fc8bf

View File

@@ -251,7 +251,7 @@ pub const SocketConfig = struct {
}
}
if (opts.getTruthy(globalObject, "hostname")) |hostname| {
if (opts.getTruthy(globalObject, "hostname") orelse opts.getTruthy(globalObject, "host")) |hostname| {
if (!hostname.isString()) {
exception.* = JSC.toInvalidArguments("Expected \"hostname\" to be a string", .{}, globalObject).asObjectRef();
return null;
@@ -287,7 +287,7 @@ pub const SocketConfig = struct {
}
if (hostname_or_unix.len == 0) {
exception.* = JSC.toInvalidArguments("Expected \"unix\" to be a non-empty string", .{}, globalObject).asObjectRef();
exception.* = JSC.toInvalidArguments("Expected \"unix\" or \"hostname\" to be a non-empty string", .{}, globalObject).asObjectRef();
return null;
}