1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

net: make listen/bind errors more informative

This commit is contained in:
Delyan Angelov
2022-01-08 17:02:03 +02:00
parent 9cbfa882e6
commit b778c1d097
2 changed files with 18 additions and 9 deletions

View File

@@ -20,6 +20,10 @@ pub const (
err_timed_out_code = errors_base + 9
)
pub fn socket_error_message(potential_code int, s string) ?int {
return socket_error(potential_code) or { return error('$err.msg; $s') }
}
pub fn socket_error(potential_code int) ?int {
$if windows {
if potential_code < 0 {