+
Skip to content

Standardize error messages + feedback #36

@hakusaro

Description

@hakusaro

I think we should standardize error messages and feedback, like what changed in Pryaxis/TShock@c4cf2d4 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载