private JSONObject errorForUnwrappedException ( Exception e , JmxRequest pJmxReq ) { Throwable cause = e . getCause ( ) ; int code = cause instanceof IllegalArgumentException ? 400 : cause instanceof SecurityException ? 403 : 500 ; return getErrorJSON ( code , cause , pJmxReq ) ; }
and extract the error code accordingly