status-im / nim-chronos

Chronos - An efficient library for asynchronous programming
https://status-im.github.io/nim-chronos/docs/chronos
Apache License 2.0
353 stars 51 forks source link

`getAcceptInfo` can raise an unlisted exception: ref ValueError #489

Closed EmilIvanichkovv closed 8 months ago

EmilIvanichkovv commented 8 months ago

If I try to compile httpserver.nim like that:

nim c chronos/apps/http/httpserver.nim

I get the following error:

nim-chronos/chronos/apps/http/httpserver.nim:563:16 Error: getAcceptInfo(getString(request.headers, AcceptHeaderName, "")) can raise an unlisted exception: ref ValueError

I trigger the problem using nim v1.6.14 ( same result with nim v1.6.18 )

EmilIvanichkovv commented 8 months ago

With this PR I suggest a simple solution for this problem, and other unlisted exceptions in functions in the file

EmilIvanichkovv commented 8 months ago

The problem was caused by out-of-date dependencies. After deleting the nimble cache and running nimble install the problem does not occur anymore