Closed prolic closed 6 years ago
This change does not match the JSON-RPC 2.0 Spec for the error object. How I read the rfc, this response should only contain code, message and data.
Maybe the trace should be in data
.
The trace is only meant for debugging in development mode, and should not be turned on in production, that's why I think it's okay to add it as additional field to the error object. The purpose of data is to show example data, how a good request looks like, also changing the data field would lead to BC break on consumer side, that's why we should not add it to data.
http://www.jsonrpc.org/specification#error_object
data A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.).
The data field is defined exactly for this behaivor.. adding some more info about the error.
see also: https://github.com/prolic/HumusAmqp/pull/56
This is a small BC as the Error Interface now has an additional method. Usually it would not be expected to have an implementation of this Error Interface in userland code, so maybe we can introduce it without new major version.
Thoughts? @oqq @thomasvargiu @bweston92