coderef

Exception handling (WebAssembly)Baseline · Widely available

Exceptions break the normal control flow of execution to represent exceptional behavior, such as an error. You can respond to the exception in JavaScript code.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since May 3, 2022. Widely available since Nov 3, 2024.

Browser support

DesktopChrome
1–94Not supported
95+Supportedsince Oct 19, 2021
Current: 155
Edge
12–94Not supported
95+Supportedsince Oct 21, 2021
Current: 154
Firefox
1–99Not supported
100+Supportedsince May 3, 2022
Current: 157
Safari
1–15.1Not supported
15.2+Supportedsince Dec 13, 2021
Current: 27
MobileChrome Android
18–94Not supported
95+Supportedsince Oct 19, 2021
Current: 155
Firefox Android
4–99Not supported
100+Supportedsince May 3, 2022
Current: 157
Safari iOS
1–15.1Not supported
15.2+Supportedsince Dec 13, 2021
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: Exception.

Feature detection

There’s no simple runtime check for this feature; rely on the support table and test in your target browsers.

Sub-features

Support for each part of the feature (10). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
webassembly.api.Exception959510015.29510015.2
webassembly.api.Exception.Exception959510015.29510015.2
webassembly.api.Exception.Exception.options_parameter_traceStack9595100✕95100✕
webassembly.api.Exception.getArg959510015.29510015.2
webassembly.api.Exception.is959510015.29510015.2
webassembly.api.Exception.stack9595100✕95100✕
webassembly.api.Tag959510015.29510015.2
webassembly.api.Tag.Tag959510015.29510015.2
webassembly.api.Tag.type✕✕✕15.2✕✕15.2
webassembly.exception-handling959510015.29510015.2