Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
Description
Our various diagnostics use a format string plus varargs to build a message. For example
this.SDE("Some error message: %s", someArgument)
One downside of this approach is that there is no compile time validation of the format string and arguments. So if the the format strings and args don't match, it can lead to unexpected error messages or runtime errors.
An alternative approach is to use string interpolation:
this.SDE(s"Some error message: ${someArgument}")
This completely avoids the possibility of format string/var args missmatch.
We should go through our diagnostic messages and switch to using string interpolation.