mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
cleanup error message
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user