Display protocol name in exceptions raised by getProtoByName() (#19808)
This commit is contained in:
parent
c43a377057
commit
8679464e49
1 changed files with 1 additions and 1 deletions
|
|
@ -214,7 +214,7 @@ proc getProtoByName*(name: string): int {.since: (1, 3, 5).} =
|
||||||
let protoent = posix.getprotobyname(name.cstring)
|
let protoent = posix.getprotobyname(name.cstring)
|
||||||
|
|
||||||
if protoent == nil:
|
if protoent == nil:
|
||||||
raise newException(OSError, "protocol not found")
|
raise newException(OSError, "protocol not found: " & name)
|
||||||
|
|
||||||
result = protoent.p_proto.int
|
result = protoent.p_proto.int
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue