Get to know MDN better
The throw_ref exception handling instruction rethrows a previously-thrown exception represented by an exnref value.
The throw_ref instruction.
The exception to rethrow, which must be an exnref value.
| throw_ref | 0x0a | throw_ref => 0x0a |
A throw_ref instruction can be used to rethrow a previously-thrown exception, as represented by an exnref value. Values of type exnref are pushed onto the stack by catch_ref and catch_all_ref clauses.
Generally, rethrowing exceptions is useful because you might want to perform an action such as cleanup or logging but then still let users know that an error ocurred.
This page was last modified on May 22, 2026 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.