code: public JSONObject getErrorJSON(int pErrorCode, Throwable pExp, JmxRequest pJmxReq) {
          JSONObject jsonObject = new JSONObject();
          jsonObject.put("status",pErrorCode);
          jsonObject.put("error",getExceptionMessage(pExp));
          jsonObject.put("error_type", pExp.getClass().getName());
          addErrorInfo(jsonObject, pExp, pJmxReq);
          if (backendManager.isDebug()) {
              backendManager.error("Error " + pErrorCode,pExp);
          }
          if (pJmxReq != null) {
              jsonObject.put("request",pJmxReq.toJSON());
          }
          return jsonObject;
      }
docs: Get the JSON representation for a an exception
  
  
  @param pErrorCode the HTTP error code to return
  @param pExp the exception or error occured
  @param pJmxReq request from where to get processing options
  @return the json representation