Display protocol name in exceptions raised by getProtoByName() (#19808)

This commit is contained in:
kraptor
2022-07-16 23:44:14 +02:00
committed by GitHub
parent c43a377057
commit 8679464e49

View File

@@ -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