From eef90636284a798ec7d928b5360057d72e78265c Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Sat, 17 Apr 2021 20:39:32 +0300 Subject: [PATCH] Update Data.cpp --- module/PocoLib/Data.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/module/PocoLib/Data.cpp b/module/PocoLib/Data.cpp index 6d77ac83..8b3c3dc4 100644 --- a/module/PocoLib/Data.cpp +++ b/module/PocoLib/Data.cpp @@ -547,7 +547,15 @@ static void ProcessPocoData() if (!inst->mFunc.IsNull()) { try { - inst->mFunc.Execute(inst->mStmt, inst->mRes.data()); + // The active method may have failed. In which case we forward the error message instead + if (!inst->mRes.failed()) + { + inst->mFunc.Execute(inst->mStmt, inst->mRes.data()); + } + else + { + inst->mFunc.Execute(inst->mStmt, inst->mRes.exception()->message()); + } } catch (const Poco::Exception & e) { LogErr("SqData.Process: %s", e.displayText().c_str()); } catch (const std::exception & e) {