Are Dynamic Exception Messages a Good Idea?
-
30-10-2019 - |
Question
I'm designing an infrastructure for a project and I've been wondering if it'd be a good idea to format the exception's message with parameters, making it dynamic.
This means, on the one hand, that exception messages can be really verbose.
The downside, which is a lot stronger, in my opinion, is that you can't expect certain messages. These can be used (though it's not a best-practice) in exception handling, testing whether the message is this or that and in logging. But what's even more disturbing is that it will make localization a lot harder if you intent on showing that message somewhere (which I do).
So my question is what's your take on it and whether you have a compromising solution, giving me both verbosity (in case I log the exception) and consistency.
Thanks.
No correct solution