proofpoint/platform — Issue #38: Add safe String.format utility
Author: markkent
Created: 2011-10-11 17:38:48+00:00
State: open

Imported from old tracking system. Originally raised P2 by dsundstrom:

String.format will throw an exception when the args don't match the format string. When this happens the original message and args are lost. Since this is common to use string formatting when creating a exception message (and exceptions are not common), this makes debugging problems much harder.

We need a safeFormat method that catches the exception for the invalid format string, and simply dumps the string and associated args.