Skip to content

Commit fecd95f

Browse files
committed
Correct error return type of Client.connect()
`ConnectTcpError` is a subset of `ConnectError`, but the 4 additional errors that `ConnectError` comes with: ```zig error{ UnsupportedUriScheme, UriMissingHost, UriHostTooLong, CertificateBundleLoadFailure, } ``` ...are never returned by `Client.connect()`. So we are communicating that this method could return 1 of those 4 types, when in reality, it never can. This commit fixes this communication error.
1 parent 4bc9c51 commit fecd95f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/std/http/Client.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1576,7 +1576,7 @@ pub fn connect(
15761576
host: []const u8,
15771577
port: u16,
15781578
protocol: Protocol,
1579-
) ConnectError!*Connection {
1579+
) ConnectTcpError!*Connection {
15801580
const proxy = switch (protocol) {
15811581
.plain => client.http_proxy,
15821582
.tls => client.https_proxy,

0 commit comments

Comments
 (0)