public static String getMessage ( Throwable ex ) { String msg = DEFAULT_ERROR_MSG ; for ( int i = 0 ; i < _keys . size ( ) ; i ++ ) { Class < ? > cl = _keys . get ( i ) ; if ( cl . isInstance ( ex ) ) { msg = _values . get ( i ) ; break ; } } return msg . replace ( MESSAGE_MARKER , ex . getMessage ( ) ) ; }
Looks up the supplied exception in the map and returns the most specific error message available for exceptions of that class .