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:
@ -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 (...) {
|
||||
|
@ -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 (...) {
|
||||
|
@ -37,6 +37,8 @@
|
||||
#include <exception>
|
||||
#include <unordered_map>
|
||||
|
||||
#include <Poco/Exception.h>
|
||||
|
||||
namespace Sqrat {
|
||||
|
||||
#if defined(__GNUC__)
|
||||
|
Reference in New Issue
Block a user