public Object convertExceptionToJson ( Throwable pExp , JmxRequest pJmxReq ) { JsonConvertOptions opts = getJsonConvertOptions ( pJmxReq ) ; try { JSONObject expObj = ( JSONObject ) converters . getToJsonConverter ( ) . convertToJson ( pExp , null , opts ) ; return expObj ; } catch ( AttributeNotFoundException e ) { // Cannot happen, since we dont use a path return null ; } }
Convert a Throwable to a JSON object so that it can be included in an error response