From 08ae539e743dcd085903cd4353341d00bff44b4c Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Sun, 31 Jan 2021 00:14:56 +0200 Subject: [PATCH] Broaden the range of handled exceptions. --- module/Sqrat/sqratAllocator.h | 4 ++-- module/Sqrat/sqratGlobalMethods.h | 6 +++--- module/Sqrat/sqratMemberMethods.h | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/module/Sqrat/sqratAllocator.h b/module/Sqrat/sqratAllocator.h index 2d05300e..294adae7 100644 --- a/module/Sqrat/sqratAllocator.h +++ b/module/Sqrat/sqratAllocator.h @@ -125,7 +125,7 @@ public: SetInstance(vm, 1, ArgFwd{}.Call(vm, 2, [](HSQUIRRELVM /*vm*/, A... a) -> C * { return new C(a...); })); - } catch (const Exception& e) { + } catch (const std::exception& e) { return sq_throwerror(vm, e.what()); } catch (...) { return sq_throwerror(vm, _SC("unknown exception occured")); @@ -497,7 +497,7 @@ public: SetInstance(vm, 1, ArgFwd{}.Call(vm, 2, [](HSQUIRRELVM /*vm*/, A... a) -> C * { return new C(a...); })); - } catch (const Exception& e) { + } catch (const std::exception& e) { return sq_throwerror(vm, e.what()); } catch (...) { return sq_throwerror(vm, _SC("unknown exception occured")); diff --git a/module/Sqrat/sqratGlobalMethods.h b/module/Sqrat/sqratGlobalMethods.h index fbb239b6..0534869b 100644 --- a/module/Sqrat/sqratGlobalMethods.h +++ b/module/Sqrat/sqratGlobalMethods.h @@ -122,7 +122,7 @@ template struct SqGlobal { #endif try { return SqGlobalProxy::template Run(vm, startIdx); - } catch (const Exception& e) { + } catch (const std::exception& e) { return sq_throwerror(vm, e.what()); } catch (...) { return sq_throwerror(vm, _SC("unknown exception occured")); @@ -148,7 +148,7 @@ template struct SqGlobal { #endif try { return SqGlobalProxy::template Run(vm, startIdx); - } catch (const Exception& e) { + } catch (const std::exception& e) { return sq_throwerror(vm, e.what()); } catch (...) { return sq_throwerror(vm, _SC("unknown exception occured")); @@ -174,7 +174,7 @@ template <> struct SqGlobal { #endif try { return SqGlobalProxy::Run(vm, startIdx); - } catch (const Exception& e) { + } catch (const std::exception& e) { return sq_throwerror(vm, e.what()); } catch (...) { return sq_throwerror(vm, _SC("unknown exception occured")); diff --git a/module/Sqrat/sqratMemberMethods.h b/module/Sqrat/sqratMemberMethods.h index d5156ea1..05cb4942 100644 --- a/module/Sqrat/sqratMemberMethods.h +++ b/module/Sqrat/sqratMemberMethods.h @@ -152,7 +152,7 @@ template struct SqMember { #endif try { return SqMemberProxy:: template Run(vm); - } catch (const Exception& e) { + } catch (const std::exception& e) { return sq_throwerror(vm, e.what()); } catch (...) { return sq_throwerror(vm, _SC("unknown exception occured")); @@ -171,7 +171,7 @@ template struct SqMember { #endif try { return SqMemberProxy::template RunC(vm); - } catch (const Exception& e) { + } catch (const std::exception& e) { return sq_throwerror(vm, e.what()); } catch (...) { return sq_throwerror(vm, _SC("unknown exception occured")); @@ -197,7 +197,7 @@ template struct SqMember { #endif try { return SqMemberProxy::template Run(vm); - } catch (const Exception& e) { + } catch (const std::exception& e) { return sq_throwerror(vm, e.what()); } catch (...) { return sq_throwerror(vm, _SC("unknown exception occured")); @@ -216,7 +216,7 @@ template struct SqMember { #endif try { return SqMemberProxy::template RunC(vm); - } catch (const Exception& e) { + } catch (const std::exception& e) { return sq_throwerror(vm, e.what()); } catch (...) { return sq_throwerror(vm, _SC("unknown exception occured")); @@ -243,7 +243,7 @@ template struct SqMember { #endif try { return SqMemberProxy::template Run(vm); - } catch (const Exception& e) { + } catch (const std::exception& e) { return sq_throwerror(vm, e.what()); } catch (...) { return sq_throwerror(vm, _SC("unknown exception occured")); @@ -262,7 +262,7 @@ template struct SqMember { #endif try { return SqMemberProxy::template RunC(vm); - } catch (const Exception& e) { + } catch (const std::exception& e) { return sq_throwerror(vm, e.what()); } catch (...) { return sq_throwerror(vm, _SC("unknown exception occured"));