1515#include < string>
1616
1717using wrapperType = cURLWrapper;
18+ auto constexpr INTERNAL_ERROR_MESSAGE = " Internal error in HTTPRequest module." ;
1819
1920void UNIXSocketRequest::download (std::variant<TRequestParameters<std::string>,
2021 TRequestParameters<nlohmann::json>,
@@ -52,7 +53,7 @@ void UNIXSocketRequest::download(std::variant<TRequestParameters<std::string>,
5253 {
5354 if (onError)
5455 {
55- onError (ex.what (), ex.responseCode ());
56+ onError (ex.what (), ex.responseCode (), ex. responseBody () );
5657 }
5758 else
5859 {
@@ -63,7 +64,7 @@ void UNIXSocketRequest::download(std::variant<TRequestParameters<std::string>,
6364 {
6465 if (onError)
6566 {
66- onError (ex.what (), NOT_USED );
67+ onError (ex.what (), NOT_USED , INTERNAL_ERROR_MESSAGE );
6768 }
6869 else
6970 {
@@ -187,7 +188,7 @@ void UNIXSocketRequest::post(std::variant<TRequestParameters<std::string>,
187188 {
188189 if (onError)
189190 {
190- onError (ex.what (), ex.responseCode ());
191+ onError (ex.what (), ex.responseCode (), ex. responseBody () );
191192 }
192193 else
193194 {
@@ -198,7 +199,7 @@ void UNIXSocketRequest::post(std::variant<TRequestParameters<std::string>,
198199 {
199200 if (onError)
200201 {
201- onError (ex.what (), NOT_USED );
202+ onError (ex.what (), NOT_USED , INTERNAL_ERROR_MESSAGE );
202203 }
203204 else
204205 {
@@ -259,7 +260,7 @@ void UNIXSocketRequest::get(std::variant<TRequestParameters<std::string>,
259260 {
260261 if (onError)
261262 {
262- onError (ex.what (), ex.responseCode ());
263+ onError (ex.what (), ex.responseCode (), ex. responseBody () );
263264 }
264265 else
265266 {
@@ -270,7 +271,7 @@ void UNIXSocketRequest::get(std::variant<TRequestParameters<std::string>,
270271 {
271272 if (onError)
272273 {
273- onError (ex.what (), NOT_USED );
274+ onError (ex.what (), NOT_USED , INTERNAL_ERROR_MESSAGE );
274275 }
275276 else
276277 {
@@ -395,7 +396,7 @@ void UNIXSocketRequest::put(std::variant<TRequestParameters<std::string>,
395396 {
396397 if (onError)
397398 {
398- onError (ex.what (), ex.responseCode ());
399+ onError (ex.what (), ex.responseCode (), ex. responseBody () );
399400 }
400401 else
401402 {
@@ -406,7 +407,7 @@ void UNIXSocketRequest::put(std::variant<TRequestParameters<std::string>,
406407 {
407408 if (onError)
408409 {
409- onError (ex.what (), NOT_USED );
410+ onError (ex.what (), NOT_USED , INTERNAL_ERROR_MESSAGE );
410411 }
411412 else
412413 {
@@ -531,7 +532,7 @@ void UNIXSocketRequest::patch(std::variant<TRequestParameters<std::string>,
531532 {
532533 if (onError)
533534 {
534- onError (ex.what (), ex.responseCode ());
535+ onError (ex.what (), ex.responseCode (), ex. responseBody () );
535536 }
536537 else
537538 {
@@ -542,7 +543,7 @@ void UNIXSocketRequest::patch(std::variant<TRequestParameters<std::string>,
542543 {
543544 if (onError)
544545 {
545- onError (ex.what (), NOT_USED );
546+ onError (ex.what (), NOT_USED , INTERNAL_ERROR_MESSAGE );
546547 }
547548 else
548549 {
@@ -603,7 +604,7 @@ void UNIXSocketRequest::delete_(std::variant<TRequestParameters<std::string>,
603604 {
604605 if (onError)
605606 {
606- onError (ex.what (), ex.responseCode ());
607+ onError (ex.what (), ex.responseCode (), ex. responseBody () );
607608 }
608609 else
609610 {
@@ -614,7 +615,7 @@ void UNIXSocketRequest::delete_(std::variant<TRequestParameters<std::string>,
614615 {
615616 if (onError)
616617 {
617- onError (ex.what (), NOT_USED );
618+ onError (ex.what (), NOT_USED , INTERNAL_ERROR_MESSAGE );
618619 }
619620 else
620621 {
0 commit comments