File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 11#include < iostream>
22#include < filesystem>
3+ #include < vector>
4+ #include < string>
35
46#include < pyjs/export_py_object.hpp>
57#include < pyjs/convert.hpp>
@@ -90,6 +92,18 @@ namespace pyjs
9092 return std::filesystem::is_directory (std::filesystem::path (p));
9193 }
9294
95+
96+ std::string get_exception_message (int exceptionPtr)
97+ {
98+ auto ptr = reinterpret_cast <std::exception *>(exceptionPtr);
99+
100+ // get traceback
101+ std::vector<std::string> traceback;
102+
103+ return std::string (ptr->what ());
104+ }
105+
106+
93107 void export_js_module ()
94108 {
95109 // interpreter itself,
@@ -126,6 +140,8 @@ namespace pyjs
126140 { std::cout << val; }));
127141
128142
143+ em::function (" get_exception_message" , &get_exception_message);
144+
129145 }
130146
131147}
You can’t perform that action at this time.
0 commit comments