mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-04 20:17:42 +00:00
Display protocol name in exceptions raised by getProtoByName() (#19808)
This commit is contained in:
@@ -214,7 +214,7 @@ proc getProtoByName*(name: string): int {.since: (1, 3, 5).} =
|
||||
let protoent = posix.getprotobyname(name.cstring)
|
||||
|
||||
if protoent == nil:
|
||||
raise newException(OSError, "protocol not found")
|
||||
raise newException(OSError, "protocol not found: " & name)
|
||||
|
||||
result = protoent.p_proto.int
|
||||
|
||||
|
||||
Reference in New Issue
Block a user