Skip to content

Commit 4610a85

Browse files
[Docs] Fix cpp exception binding example (#16889)
1 parent 8373cfa commit 4610a85

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

site/source/docs/porting/Debugging.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ returns the ``what`` function call result.
158158

159159
.. code-block:: cpp
160160
161-
#include <bind.h>
161+
#include <emscripten/bind.h>
162162
163163
std::string getExceptionMessage(intptr_t exceptionPtr) {
164164
return std::string(reinterpret_cast<std::exception *>(exceptionPtr)->what());
@@ -168,6 +168,7 @@ returns the ``what`` function call result.
168168
emscripten::function("getExceptionMessage", &getExceptionMessage);
169169
};
170170
171+
This requires using the linker flag ``--bind``.
171172
Once such a function has been created, exception handling code in javascript
172173
can call it when receiving an exception from WASM. Here the function is used
173174
in order to log the thrown exception.

0 commit comments

Comments
 (0)