unibeautify icon indicating copy to clipboard operation
unibeautify copied to clipboard

Error handling utility / Generate debugging information

Open prettydiff opened this issue 7 years ago • 6 comments

Perhaps there should be a utility to provide error handling. This utility can accept a title, message, and stack trace and format that information properly to the executing environment whether HTML, CLI, or one of the various IDEs.

prettydiff avatar Nov 12 '17 21:11 prettydiff

Atom-Beautify generated a Markdown file for debug information: https://github.com/Glavin001/atom-beautify/blob/master/src/beautify.coffee#L288-L509

With Unibeautify, I would like to build debugging into the core, and export as JSON. Then the JSON can be read by https://github.com/Unibeautify/assistant and the user has an interact assistant to help them resolve their issue.

Glavin001 avatar Feb 09 '18 20:02 Glavin001

For the moment I am using a micro-utility to provide support for this: https://github.com/Unibeautify/parse-framework/blob/master/services.ts#L187-L205

But I could probably spin this out to be an external utility that accepts a callback.

prettydiff avatar Feb 14 '18 10:02 prettydiff

No need. Unibeautify is going to need fairly unique debugging information being returned, such as the intermediate results from multiple beautifiers in series (see #4 ) and more.

I may start working on this task soon since debugging is very important.

Glavin001 avatar Feb 14 '18 14:02 Glavin001

  • Editors will need to provide some info: Version information such as atom, apm, electron, npm, etc.
  • Stack traces, would they come from editors or Unibeautify core? Or both?
  • JSON output would be inserted into https://assistant.unibeautify.com/#/debug. Maybe see if we can launch the user's browser to that page upon a debug request with the JSON already there?
  • For Atom specifically, I'm watching https://github.com/atom/town-crier to see if any services are ever implemented. Would be nice to auto-generate an issue based off of a nice form

stevenzeck avatar Mar 14 '18 17:03 stevenzeck

Town Crier looks beautiful.

The checklist you have above is great! I have been thinking we should also report the version of package dependencies, too, such as prettier and js-beautify, etc. And also intermediate steps, such as when beautifiers: ["Prettier", "JS-Beautify"] is configured, it beautifies twice and could be problems with either. I would also like the Assistant to guide the user to determine which beautifier, if any, was the culprit and then report to those instead of the Unibeautify core.

Glavin001 avatar Mar 14 '18 18:03 Glavin001

Right, Unibeautify core would just be responsible for gathering the information and generating the JSON. Assistant would read it and guide users through the issue.

stevenzeck avatar Mar 14 '18 20:03 stevenzeck