Simple-Web-Server crashes on probably wrongly catched exception

65 Views Asked by At

I want to use https://github.com/eidheim/Simple-Web-Server as base for my server program. It is nice and mostly works, but when there is no file to load at asked address, it generates an exception and fails to catch it properly, so it crashes.

way to reproduce:

  1. compile http_example
  2. run program
  3. enter 127.0.0.1:8080/badfile.bad
  4. server crashes and says it has an exception

is there easy way to fix it?

1

There are 1 best solutions below

0
On

I managed it but in nasty way.
just got rid of exceptions and get some "if"s