Skip to main content
2 of 13
Changed language to be less ranty.
user avatar
user avatar

Why do many exceptions not contain useful details?

It seems there is a certain amount of agreement that exception messages should contain useful details.

Why is it that many common exceptions from system components do not contain useful details?

A few examples:

  • .NET List index access ArgumentOutOfRangeException does not tell me the index value that was tried and was invalid, nor does it tell me the allowed range.
  • Basically all exception messages from the MSVC C++ standard library are utterly useless (in the same vein as above).
  • Oracle Exceptions in .NET, telling you (paraphrased) "TABLE OR VIEW not found", but not which one.

So, to me it seems that for the most part exception messages do not contain sufficient details to be useful. Are my expectations out of line? Am I using Exceptions wrong that I even notice this? Or maybe my impression is wrong an a majority of exceptions do actually provide useful details?

Martin Ba
  • 7.7k
  • 7
  • 36
  • 57