1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

properly catch exceptions by reference

This commit is contained in:
Steffen Vogel 2019-02-12 17:05:44 +01:00
parent 0348749de6
commit c4ab3cbbcb
2 changed files with 3 additions and 3 deletions

View file

@ -193,7 +193,7 @@ int main(int argc, char *argv[])
return 0;
}
catch (std::exception *e) {
logger->error(e->what());
catch (RuntimeError &e) {
logger->error("{}", e.what());
}
}

View file

@ -258,7 +258,7 @@ int protocol_cb(lws *wsi, enum lws_callback_reasons reason, void *user, void *in
try {
new (c) Connection(wsi);
}
catch (InvalidUrlException e) {
catch (InvalidUrlException &e) {
lws_close_reason(wsi, LWS_CLOSE_STATUS_PROTOCOL_ERR, (unsigned char *) "Invalid URL", strlen("Invalid URL"));
return -1;
}