diff --git a/src/box/lua/call.cc b/src/box/lua/call.cc index 7ff4224ff091c6cdbdf1680dc6a400c6653a1c59..786954c886505819339b44a13bc40e0f3ee0737a 100644 --- a/src/box/lua/call.cc +++ b/src/box/lua/call.cc @@ -342,7 +342,7 @@ lbox_raise(lua_State *L) /* re-throw saved exceptions (if any) */ if (cord()->exc == NULL) return 0; - throw cord()->exc; + cord()->exc->raise(); return 0; } diff --git a/src/exception.h b/src/exception.h index e46e611187ed5f6ef7ab6f540791894235738366..dcf01dc2262599ed0d81803bd9d604006a7997eb 100644 --- a/src/exception.h +++ b/src/exception.h @@ -37,6 +37,10 @@ class Exception: public Object { public: void *operator new(size_t size); void operator delete(void*); + virtual void raise() + { + throw this; + } const char * errmsg() const @@ -45,6 +49,7 @@ class Exception: public Object { } virtual void log() const = 0; + virtual ~Exception() {} protected: Exception(const char *file, unsigned line); @@ -63,6 +68,11 @@ class Exception: public Object { class SystemError: public Exception { public: + virtual void raise() + { + throw this; + } + int errnum() const { @@ -87,6 +97,11 @@ class SystemError: public Exception { class ClientError: public Exception { public: + virtual void raise() + { + throw this; + } + virtual void log() const; int