Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
JavaScript
/
Error handling
Why pass a caught failure as the cause option when creating a higher-level Error?
from Error handling
Node 24
beginner
1 min
Why pass a caught failure as the cause option when creating a higher-level Error?
It preserves the original failure for diagnosis while the new Error adds operation context.
It guarantees that the new Error has the same class as the original.
It automatically retries the failed operation once.
It converts every thrown value into a TypeError.
Check
Ask AI about this kata
Report an error
next kata
What does this program print?
Predict the output
A new version is available
Reload