aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-01-17 16:47:45 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-01-17 16:47:45 -0800
commit9e403fc8bf2b02baa200b4e41871a22eda3ef3c1 (patch)
tree9b0e3f15e8375e377c231a45c38d2abb2a5a4998
parentfd0edd7aa086b606d7d8c64f37d3f0cceca7b77b (diff)
downloadbun-9e403fc8bf2b02baa200b4e41871a22eda3ef3c1.tar.gz
bun-9e403fc8bf2b02baa200b4e41871a22eda3ef3c1.tar.zst
bun-9e403fc8bf2b02baa200b4e41871a22eda3ef3c1.zip
cleanup error message
-rw-r--r--src/bun.js/api/bun/socket.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bun.js/api/bun/socket.zig b/src/bun.js/api/bun/socket.zig
index 7a3176072..925db901d 100644
--- a/src/bun.js/api/bun/socket.zig
+++ b/src/bun.js/api/bun/socket.zig
@@ -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;
}