Closed
Description
I have a cpp file test.cpp:
#include <stdio.h>
#include <iostream>
#include <emscripten/bind.h>
#include <emscripten/val.h>
int main()
{
throw std::invalid_argument("test error");
printf("\ndone\n");
return 0;
}
Compiled with emcc --bind -fexceptions -std=c++11 test.cpp -o test.js
I would like the code to print out the exception message in some way so the user has a description of the error.
When I run it I get exception thrown: 5246984
and Uncaught 5246984
.
It does not appear as though emscripten will print any distinguishable message.
Does emscripten have this feature?
If not, I was thinking of adding a thow
method to val
that would accept a message and possibly a javascript exception class.