safeToString

public static String safeToString(Object value)

Returns a string representation of the user supplied value accounting for any possible runtime exceptions. This code will never fail, but may return a synthetic error string if exceptions were thrown.

Return

a best-effort string representation of the given value, even if exceptions were thrown.

Parameters

value

the value to be formatted.