1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-06-16 07:07:13 +02:00

Handle Poco exceptions explicitly.

This commit is contained in:
Sandu Liviu Catalin
2021-02-20 21:22:12 +02:00
parent 505650837e
commit 1f2b75ed26
12 changed files with 119 additions and 3 deletions

View File

@ -122,6 +122,8 @@ template <class R> struct SqGlobal {
#endif
try {
return SqGlobalProxy<R>::template Run<A...>(vm, startIdx);
} 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 (...) {
@ -148,6 +150,8 @@ template <class R> struct SqGlobal<R&> {
#endif
try {
return SqGlobalProxy<R&>::template Run<A...>(vm, startIdx);
} 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 (...) {
@ -174,6 +178,8 @@ template <> struct SqGlobal<void> {
#endif
try {
return SqGlobalProxy<void>::Run<A...>(vm, startIdx);
} 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 (...) {

View File

@ -152,6 +152,8 @@ template <class C,class R> struct SqMember {
#endif
try {
return SqMemberProxy<C, R>:: template Run<A...>(vm);
} 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 (...) {
@ -171,6 +173,8 @@ template <class C,class R> struct SqMember {
#endif
try {
return SqMemberProxy<C,R>::template RunC<A...>(vm);
} 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 (...) {
@ -197,6 +201,8 @@ template <class C, class R> struct SqMember<C,R&> {
#endif
try {
return SqMemberProxy<C,R&>::template Run<A...>(vm);
} 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 (...) {
@ -216,6 +222,8 @@ template <class C, class R> struct SqMember<C,R&> {
#endif
try {
return SqMemberProxy<C,R&>::template RunC<A...>(vm);
} 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 (...) {
@ -243,6 +251,8 @@ template <class C> struct SqMember<C, void> {
#endif
try {
return SqMemberProxy<C, void>::template Run<A...>(vm);
} 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 (...) {
@ -262,6 +272,8 @@ template <class C> struct SqMember<C, void> {
#endif
try {
return SqMemberProxy<C,void>::template RunC<A...>(vm);
} 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 (...) {

View File

@ -37,6 +37,8 @@
#include <exception>
#include <unordered_map>
#include <Poco/Exception.h>
namespace Sqrat {
#if defined(__GNUC__)