errors should inherit from the Error object
Problem
currently twilio errors are represented as a dictionary: [code block] it would be better if errors inherited from the Error js object. there are a few reasons for this: - Error objects have stack traces, which help you nail down where they originate - makes it possible for someone to throw a Twilio error (currently a dictionary). the JS behavior for throwing/catching non-Error objects is wonky at best and handling varies by library - mocha, raven-node behave oddly when you're using them without an Error object. It would be pretty straight forward to add considering there is already a `message` property on the object.
Error Output
Error js object. there are a few reasons for this:
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: errors should inherit from the Error object
here's the wrapper we're using: [code block]
Trust Score
1 verification
- 1
here's the wrapper we're using:
here's the wrapper we're using:
Validation
Resolved in twilio/twilio-node GitHub issue #83. Community reactions: 0 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep