[C++][Pistache] Catch exception instead of runtime_error (#3225)

* [C++][Pistache] Replace runtime_error with std::exception

* [C++][Pistache] Update Petstore sample

* [C++][Pistache] Fix catch-value warning
This commit is contained in:
Mateusz Szychowski (Muttley)
2019-06-26 19:13:54 +02:00
committed by sunn
parent 7af2bc8dff
commit 68a5fa4c8b
7 changed files with 30 additions and 30 deletions

View File

@@ -51,7 +51,7 @@ void StoreApi::delete_order_handler(const Pistache::Rest::Request &request, Pist
//send a 400 error
response.send(Pistache::Http::Code::Bad_Request, e.what());
return;
} catch (std::runtime_error &e) {
} catch (std::exception &e) {
//send a 500 error
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
return;
@@ -66,7 +66,7 @@ void StoreApi::get_inventory_handler(const Pistache::Rest::Request &request, Pis
//send a 400 error
response.send(Pistache::Http::Code::Bad_Request, e.what());
return;
} catch (std::runtime_error &e) {
} catch (std::exception &e) {
//send a 500 error
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
return;
@@ -83,7 +83,7 @@ void StoreApi::get_order_by_id_handler(const Pistache::Rest::Request &request, P
//send a 400 error
response.send(Pistache::Http::Code::Bad_Request, e.what());
return;
} catch (std::runtime_error &e) {
} catch (std::exception &e) {
//send a 500 error
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
return;
@@ -103,7 +103,7 @@ void StoreApi::place_order_handler(const Pistache::Rest::Request &request, Pista
//send a 400 error
response.send(Pistache::Http::Code::Bad_Request, e.what());
return;
} catch (std::runtime_error &e) {
} catch (std::exception &e) {
//send a 500 error
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
return;