Possible improvement to error logging in the console
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:
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?
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
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?