We need a consistent way to describe errors. Errors that happen on the server should have the same format as on the client. I currently use new Error('some message') to represent errors. In order to expose them to the client I use a json serialization.
We may want to switch to a custom SubstanceError class that stores a an errorCode (e.g. 'authentication-failed') which we can translate to a human-readable string using this.i18n.t.
We need a consistent way to describe errors. Errors that happen on the server should have the same format as on the client. I currently use
new Error('some message')
to represent errors. In order to expose them to the client I use a json serialization.On the client I turn it back into a rich error object.
We may want to switch to a custom SubstanceError class that stores a an errorCode (e.g. 'authentication-failed') which we can translate to a human-readable string using
this.i18n.t
.@oliver---- thoughts?