code: public static Map<String, Object> errorToMap(Throwable e) {
          Map<String, Object> m = new HashMap<String, Object>();
          m.put("requestId", MDC.get("requestId"));
          m.put("message", e.getMessage());
          m.put("errorClass", e.getClass().getName());
          return m;
      }
docs: Convert error to map
  
  @param e
  @return