4 ms·
Same, although I always thought it was a terrible practice as I'm always reading error.message or error.stack straight away. And if an error does not have a sta
by Gravyness 5y ago
Same, although I always thought it was a terrible practice as I'm always reading error.message or error.stack straight away. And if an error does not have a stack then I will call the police on whoever wrote this shit!
- prmph 5y agoI recently started throwing bare string instead of Error objects, just because of all the Error: prefixes that are prepended to the error message when you throw an Error. It just clutters up the stack trace. More generally I wish there was an Error constructor that automatically records and the function, arguments, and other semantically meaningful information when called. File and line numbers do not make for a pleasant experience when inspecting a stack trace.