code: public static JSONObjectException wrapWithPath(Throwable src, Reference ref)
      {
          JSONObjectException jme;
          if (src instanceof JSONObjectException) {
              jme = (JSONObjectException) src;
          } else {
              String msg = src.getMessage();
              if (msg == null || msg.length() == 0) {
                  msg = "(was "+src.getClass().getName()+")";
              }
              jme = new JSONObjectException(msg, null, src);
          }
          jme.prependPath(ref);
          return jme;
      }
docs: Method that can be called to either create a new JsonMappingException
  (if underlying exception is not a JsonMappingException), or augment
  given exception with given path/reference information.