Closed sanbornhilland closed 4 years ago
Sounds like a good idea! We just need to make sure this is well discussed, when available, as it would break applications using janus.js as it is now (e.g., assuming strings where there wouldn't be anymore).
If in debug mode, adding LINE and FILE to the json output would be nice too! Tried to hack that in as a feature but it was too nasty to brag about.. but if you're redoing the error handling, I thought I'd mention it. Helpful when trying to figure out where in the code error messages are coming from.
I just want to mention, that there is an RFC 7807 describing error format.
A long time passed and we're not planning to work on this, so I'll close.
In most places error callbacks receive only descriptions of the error that occurred. In order to map errors then, we need to do string matching which is a pretty brittle approach. It would be useful to add error objects with stable error codes such as this:
I think this would probably be sufficient to solve the issue without adding a whole lot of complexity.