code: public static RuntimeException handle(Throwable e) {
          if (e instanceof CRestException) {
              return handle((CRestException) e);
          }else if (e instanceof RequestException) {
              return handle((RequestException) e);
          } else if (e instanceof IllegalArgumentException) {
              return handle((IllegalArgumentException) e);
          } else if (e instanceof IllegalStateException) {
              return handle((IllegalStateException) e);
          } else if (e instanceof InvocationTargetException) {
              return handle((InvocationTargetException) e);
          } else {
              return new CRestException(e.getMessage(), e);
          }
      }
docs: Handles any kind of exception, wrapping it into a CRestException.
  <p>NB: IllegalArgumentException and IllegalStateException are not wrapped.</p>
  @param e
  @return a wrapped CRestException or the original IllegalArgumentException or IllegalStateException