better (thread) error handling
This commit is contained in:
9
ml.h
9
ml.h
@@ -67,8 +67,10 @@ private:
|
||||
|
||||
|
||||
// An exception thrown by the lisp
|
||||
class MlError {
|
||||
class MlError : public std::exception {
|
||||
public:
|
||||
MlError() = delete;
|
||||
|
||||
// Create an error with the value that caused the error,
|
||||
// the scope where the error was found, and the message.
|
||||
MlError(const MlValue &v, MlEnvironment const &env, const char *msg);
|
||||
@@ -79,7 +81,10 @@ public:
|
||||
~MlError();
|
||||
|
||||
// Get the printable error description.
|
||||
std::string description();
|
||||
std::string description() const;
|
||||
|
||||
// inherited from std::exception
|
||||
virtual const char* what() const noexcept;
|
||||
|
||||
private:
|
||||
MlValue *cause;
|
||||
|
||||
Reference in New Issue
Block a user