Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/src/runtime_exceptions.js
4128 views
1
/**
2
* @license
3
* Copyright 2023 The Emscripten Authors
4
* SPDX-License-Identifier: MIT
5
*/
6
7
#if EXCEPTION_STACK_TRACES && !WASM_EXCEPTIONS
8
// Base Emscripten EH error class
9
class EmscriptenEH extends Error {}
10
11
#if SUPPORT_LONGJMP == 'emscripten'
12
class EmscriptenSjLj extends EmscriptenEH {}
13
#endif
14
15
class CppException extends EmscriptenEH {
16
constructor(excPtr) {
17
super(excPtr);
18
this.excPtr = excPtr;
19
#if !DISABLE_EXCEPTION_CATCHING
20
const excInfo = getExceptionMessage(excPtr);
21
this.name = excInfo[0];
22
this.message = excInfo[1];
23
#endif
24
}
25
}
26
#endif // EXCEPTION_STACK_TRACES && !WASM_EXCEPTIONS
27
28