orion-core icon indicating copy to clipboard operation
orion-core copied to clipboard

Standardize error messages + feedback

Open hakusaro opened this issue 7 years ago • 2 comments

I think we should standardize error messages and feedback, like what changed in https://github.com/NyxStudios/TShock/commit/c4cf2d496ddd1dc871be77a861a793d78dd77da2 with /register in TShock.

I think any error message that gets sent to either the console or a player should have not only a clear message, but a reasonable solution attached too.

Bad:

  1. There was a problem with the database. [StackTrace]
  2. A user already exists by that name.
  3. That group does not exist!

Good:

  1. There was a problem with the database. [StackTrace]. To solve: make sure that your database connection information is correct in the config file, and that the database is running. If you're using MySQL, run netstat -tulpn to verify that MySQL is listening on the port you're trying to connect to.
  2. That user account already exists. Try re-registering with a different username.
  3. The group "adminz" doesn't exist. Did you mean "admins"? If you need to, create a new group with [syntax for new group creation].

In other words, error messages should be both informative and actionable. If the error message is something we can't expect someone to solve, we should make it clear that they need to report the issue on the forums or on Github. Look at what Ruby does if Ruby dies:

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
Don't forget to include the above Crash Report log file.
For details: http://www.ruby-lang.org/bugreport.html

hakusaro avatar Oct 10 '16 03:10 hakusaro

In addition, we should be using localized strings from the get-go. However, logging should still be done in English. There's no point localizing logs, IMO.

kevzhao2 avatar Sep 11 '19 22:09 kevzhao2

This sounds good, but will require sometime to champion it. Will devs have a service available that provides things like 'good 3.'? Is someone going to produce a general error reporting standard to be followed inside TS/Orion? Who will be responsible for ensuring code contributions provide the quality this proposal suggests?

QuiCM avatar Sep 12 '19 00:09 QuiCM