Module 10 ¡ Error Handling: throw, try, catch, finally, and Reading a Stack Trace
The Errors Pack: Contest Patterns, Six Interview Questions and a Bug Gallery
ProReading
Rafi has a frontend interview on Thursday. His friend passed last month and says the error questions are always the same. "What does finally do with a return?" "Can try catch an error from a setTimeout?" "What is an error-first callback?" He also says the take-home task had a log file full of stack traces. The fast candidates were the ones who read the traces as data.
Checking what this lesson needs for youâĻ
What is inside The Errors Pack: Contest Patterns, Six Interview Questions and a Bug Gallery
- Pattern 1: validate, count, and keep going
- Pattern 2: walk a cause chain once
- Pattern 3: a stack trace is text you can parse
- Interview question 1: what does finally do with a return?
- Interview question 2: can try catch a throw from a callback, and from a promise?
- Interview question 3: what is the error-first callback convention?
- Interview question 4: here is a stack trace. Where is the bug?
- Interview question 5: why should a custom error extend Error?
- Interview question 6: what do you do with an error you cannot recover from?