Autofac: Add links to troubleshooting documentation in exception messages

Problem Statement

Despite having reasonably clear error messages for our exceptions, there continues to be an… inordinate… number of StackOverflow questions that are all effectively titled “Autofac DependencyResolutionException” (which isn’t a question and largely indicates folks haven’t actually tried fixing it, but I digress). It’s unclear whether the message is still confusing to people or whether it’s a case of “TL;DR.”

Desired Solution

It may be helpful to:

  • Create documentation pages for troubleshooting/explaining specific well-known cases, like:
    • Missing a dependency registration.
    • Error during instantiation.
  • Create explicit bit.ly links to these pages.
  • Include the links in the associated exception messages to get people right to the documentation.

Alternatives You’ve Considered

  • Make the messages more robust: Puts the information right where it needs to be, but I think the messages and inner exceptions are getting long enough that folks have stopped actually reading.
  • Link to existing documentation: While we do have some good docs, it might be good to have more “purpose-built” docs for specific situations to help folks that are overwhelmed by the quantity of things that may be going wrong. It might be good to restructure the existing stuff so we don’t have duplicate info to maintain if we add these new docs.

Additional Context

It doesn’t have to be bit.ly, but:

  • We probably do want to use a link shortener so the underlying link can be changed if needed without changing the code/exception message.
  • Whatever link shortener we pick should allow us to change the link later. Some are one-and-done and you can’t change the underlying link.
  • It’d be nice if it was a custom Autofac-related domain, but I’m not sure we have anyone who wants to both buy a domain (plus keep it going) and pay for the “custom domains” package on a link shortener service.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 24 (24 by maintainers)

Most upvoted comments

Right, so this has been an entertaining morning, during which time our docs were entirely broken for an hour or two.

Basically, that original owner of the autofaccn project just deleted the project entirely, which led to our docs getting stuck in a redirect loop. I figured out the redirect loop was down to docs.autofac.org being set as the Canonical name (which it hasn’t really been for years, because of the translation snafu).

I then claimed the project name autofaccn in the name of autofac by creating a blank project (https://github.com/autofac/CnRedirectPlaceholder) and creating that now-available project under our ownership.

I’ve put in place a redirect that will take an existing autofaccn link (e.g. https://autofaccn.readthedocs.io/en/latest/getting-started/index.html) and push the user to the right place, but I can’t do that for the root landing page, so I’ve just had to put a “things have moved” link at https://autofaccn.readthedocs.io/).

This isn’t ideal, but at least existing links from StackOverflow answers won’t break.

Feel free to read the blow-by-blow: https://github.com/readthedocs/readthedocs.org/issues/8134#issuecomment-834993090.

As @tillig said, a bit of a cluster.

Ah, and 👋 hey all, hope you’re all doing well! 😎