From 655ce0a39e1e000103cdc8065c689b0a72ba47fb Mon Sep 17 00:00:00 2001 From: Fatur Muhammad Date: Sat, 6 Apr 2024 04:16:12 +0700 Subject: [PATCH] need to handle connection to payment better --- src/module/payment/services/payment_processing.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module/payment/services/payment_processing.cpp b/src/module/payment/services/payment_processing.cpp index f7cc657..13fb32b 100644 --- a/src/module/payment/services/payment_processing.cpp +++ b/src/module/payment/services/payment_processing.cpp @@ -116,7 +116,7 @@ namespace gaboot auto res = cpr::Post(m_url, body, header); - if (res.text.empty()) throw std::runtime_error("UNKNOWN ERROR 01 - Check your internet access"); + if (!res.status_code) throw std::runtime_error("UNKNOWN ERROR 01 - Check your internet access"); auto json = nlohmann::ordered_json::parse(res.text);