aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index aed9348..0347146 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -21,7 +21,7 @@
#include <stdarg.h>
#include <string.h>
-#include <stdexcept>
+#include <exception>
#include <glib.h>
#include <glib/gprintf.h>
@@ -88,15 +88,17 @@ Execute::step(const gchar *macro, gint stop_pos)
#endif
try {
- /* convert bad_alloc exceptions */
+ /*
+ * convert bad_alloc and other C++ standard
+ * library exceptions
+ */
try {
if (interface.is_interrupted())
throw State::Error("Interrupted");
State::input(macro[macro_pc]);
- } catch (std::bad_alloc &alloc) {
- throw State::Error("bad_alloc: %s",
- alloc.what());
+ } catch (std::exception &error) {
+ throw State::StdError(error);
}
} catch (State::Error &error) {
error.pos = macro_pc;