From cb9c5019f857b4f4c415c86b8ecff7c4808457f8 Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Fri, 2 Apr 2021 17:59:20 +0300 Subject: [PATCH] Include special handling for POCO exceptions in constructors. --- module/Sqrat/sqratAllocator.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/module/Sqrat/sqratAllocator.h b/module/Sqrat/sqratAllocator.h index 294adae7..eae318ca 100644 --- a/module/Sqrat/sqratAllocator.h +++ b/module/Sqrat/sqratAllocator.h @@ -125,6 +125,8 @@ public: SetInstance(vm, 1, ArgFwd{}.Call(vm, 2, [](HSQUIRRELVM /*vm*/, A... a) -> C * { return new C(a...); })); + } catch (const Poco::Exception& e) { + return sq_throwerror(vm, e.displayText().c_str()); } catch (const std::exception& e) { return sq_throwerror(vm, e.what()); } catch (...) { @@ -497,6 +499,8 @@ public: SetInstance(vm, 1, ArgFwd{}.Call(vm, 2, [](HSQUIRRELVM /*vm*/, A... a) -> C * { return new C(a...); })); + } catch (const Poco::Exception& e) { + return sq_throwerror(vm, e.displayText().c_str()); } catch (const std::exception& e) { return sq_throwerror(vm, e.what()); } catch (...) {