SAFE-template icon indicating copy to clipboard operation
SAFE-template copied to clipboard

Possible improvement to error logging in the console

Open jwthomson opened this issue 1 year ago • 2 comments

Recently an issue was raised in the SAFE Dojo repo which was ultimately as the result of an error message being a bit buried.

Link: https://github.com/CompositionalIT/SAFE-Dojo/issues/185

The error message in question: image

Here the issue is with the server but Vite's errors sort of "steal the show" and turn attention to the client, which is misleading. This is particularly bad for people new to the SAFE stack since they are still trying to get to grips with everything. Is there anything we could do to make errors like this clearer?

jwthomson avatar Oct 11 '24 15:10 jwthomson

I would say to emphasise that message as a "warning". perhaps colour code it in yellow to distinguish it from the rest of the logs and make it easier to spot.

Red would be misleading as it suggests that the system panicked but it hasn't in this case

aplikethewatch avatar Oct 25 '24 14:10 aplikethewatch

Some options:

  • Preempt this by explicitly checking whether the port is available before the server is launched, and logging a warning if it's not.
  • Not necessarily a good idea, but we could hook into the font coloring in Helpers.fs.
  • Make use of Spectre.Console?

mattgallagher92 avatar Oct 25 '24 16:10 mattgallagher92