Wang Qiwen
Follow

Addressable Errors

February 4, 2016 (over 10 years ago)|2 min read

One of the biggest problems with debugging is that error and warning messages are static. The only way for errors to become more useful and evolve is for authors to tweak them and launch a new version of their software.

Unfortunately, some errors are rare and hard to reproduce. You might stumble upon them in a log-file with little context. Deploying new code is costly and time-consuming, and the error is not guaranteed to disappear or become more debuggable.

There’s also a limit to how useful error messages can be by themselves (although it’s a very good idea to constantly improve them (opens in a new tab).

The usual way to find out more about an error is to Google it to learn from others. But even then, user feedback tends to be scattered in many different places, some of which the project’s authors hardly ever visit.

The solution is simple: attach URLs

[1] to all your errors and make them collaborative [2]. GitHub wikis, gists or issues are good candidates for hosting these. Bonus points: shorten them to make live debugging (opens in a new tab) easier.

References

  1. [1]

    React warning keys

    Author observation from browser developer tools; the linked documentation is the supporting source.

    Source

  2. [2]

    PHP manual: paamayim nekudotayim

    The manual and its user comments are cited for practical examples and error conventions.

    Source

Related writing