public static String createErrorMessage ( HttpException exception ) { String json = tryParseAsJsonError ( exception . content ( ) ) ; if ( json != null ) { return json ; } String msg = "HTTP code " + exception . code ( ) ; if ( isHtml ( exception . content ( ) ) ) { return msg ; } return msg + ": " + StringUtils . left ( exception . content ( ) , MAX_ERROR_MSG_LEN ) ; }
Tries to form a short and relevant error message from the exception to be displayed in the console .