digitalbazaar / jsonld.js

A JSON-LD Processor and API implementation in JavaScript
https://json-ld.org/
Other
1.66k stars 195 forks source link

Determine how to express details in error messages. #441

Open davidlehn opened 3 years ago

davidlehn commented 3 years ago

An update changed one error to include data in the error message: https://github.com/digitalbazaar/jsonld.js/pull/421

The general pattern everywhere else is to keep the error messages to static text of what happened and put details in a structured object attached to the error. When you can easily inspect an error this works well. When you just see a simple log message, it may not have any of the details and cause confusion.

Should more messages have inline details? Should none have them? How do you pick which details? Should the details be stringified as JSON in the message?