Skip to content

Commit 0d6a422

Browse files
committed
Put Unwind and CatchThrow in C++ exception hierarchy
should cut down on the "unknown exception" crash messages
1 parent 5f8f3c3 commit 0d6a422

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

include/clasp/core/exceptions.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ namespace core {
199199
class DebugStream;
200200

201201
#pragma GCC visibility push(default)
202-
class ATTR_WEAK CatchThrow {
202+
class ATTR_WEAK CatchThrow : public std::exception {
203203
virtual void keyFunctionForVtable() ATTR_WEAK;
204204

205205
private:
@@ -208,19 +208,22 @@ class ATTR_WEAK CatchThrow {
208208
public:
209209
CatchThrow(T_sp tag) : _Tag(tag){};
210210
T_sp getTag() { return this->_Tag; };
211+
const char* what() const noexcept override { return "Lisp Throw exception"; }
211212
};
212213

213-
class ATTR_WEAK Unwind {
214+
class ATTR_WEAK Unwind : public std::exception {
214215
virtual void keyFunctionForVtable() ATTR_WEAK;
215216

216217
private:
217218
void* _Frame; // NOT GC'd use FIXNUM tagged_ptr
218219
size_t _Index;
219220

220221
public:
221-
ATTR_WEAK Unwind(void* frame, size_t index) : _Frame(frame), _Index(index){};
222+
ATTR_WEAK Unwind(void* frame, size_t index)
223+
: _Frame(frame), _Index(index){};
222224
void* getFrame() const { return this->_Frame; };
223225
size_t index() const { return this->_Index; };
226+
const char* what() const noexcept override { return "Lisp Unwind exception"; }
224227
};
225228

226229
#pragma GCC visibility pop

0 commit comments

Comments
 (0)