code: 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;
          }
      }
docs: Convert a Throwable to a JSON object so that it can be included in an error response
  
  @param pExp throwable to convert
  @param pJmxReq the request from where to take the serialization options
  @return the exception.