Print exception to stderr
This commit is contained in:
parent
e3ee4a445d
commit
ba0fb29573
2
main.cpp
2
main.cpp
|
@ -62,8 +62,10 @@ int main(int argc, char** argv) {
|
|||
try {
|
||||
std::rethrow_exception(ep);
|
||||
} catch (const std::exception& e) {
|
||||
fprintf(stderr, "Exception thrown on %s: %s\n", req.path.c_str(), e.what());
|
||||
serve_error(req, res, config, "500: Internal server error", std::nullopt, e.what());
|
||||
} catch (...) {
|
||||
fprintf(stderr, "Exception thrown on %s: Unknown exception\n", req.path.c_str());
|
||||
serve_error(req, res, config, "500: Internal server error", std::nullopt, "Unknown exception");
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue