Tin mới
JavaScript: Scripting language
Web APIs: Programming interfaces
Structuring content with HTML module
Dynamic scripting with JavaScript module
Error > Differentiate between similar errors
It is sometimes useful to catch an error and re-throw it with a new message. In this case you should pass the original error into the constructor for the new Error, as shown.
This page was last modified on Jan 21, 2026 by MDN contributors.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.