From 0e743376ba4c30724b7d17181b0b98e0aa9a0c01 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 26 Jun 2021 16:11:39 +0300 Subject: =?UTF-8?q?fixes=20#2924=20(CurrencyRates:=20=D0=BF=D0=B0=D0=B4?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF=D1=80=D0=B8=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=BD=D0=B2=D0=B5=D1=80=D1=82=D0=B0=D1=86=D0=B8=D0=B8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/CurrencyRates/src/CurrencyConverter.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'protocols/CurrencyRates') diff --git a/protocols/CurrencyRates/src/CurrencyConverter.cpp b/protocols/CurrencyRates/src/CurrencyConverter.cpp index a129edd784..cb9f86e8b3 100644 --- a/protocols/CurrencyRates/src/CurrencyConverter.cpp +++ b/protocols/CurrencyRates/src/CurrencyConverter.cpp @@ -181,8 +181,15 @@ INT_PTR CALLBACK CurrencyConverterDlgProc(HWND hDlg, UINT msg, WPARAM wp, LPARAM const auto pProvider = get_currency_converter_provider(); assert(pProvider); if (pProvider) { - double dResult = pProvider->Convert(dAmount, from, to); - CMStringW sResult(FORMAT, L"%.2lf %s = %.2lf %s", dAmount, from.GetName().c_str(), dResult, to.GetName().c_str()); + CMStringW sResult; + + try { + double dResult = pProvider->Convert(dAmount, from, to); + sResult.Format(L"%.2lf %s = %.2lf %s", dAmount, from.GetName().c_str(), dResult, to.GetName().c_str()); + } + catch (std::exception& e) { + sResult = e.what(); + } SetDlgItemText(hDlg, IDC_EDIT_RESULT, sResult); } } -- cgit v1.2.3