Package com.sforce.soap.partner.fault.wsc

Examples of com.sforce.soap.partner.fault.wsc.ApiFault


    if (th == null) {
      return null;
    }

    if (th instanceof ApiFault) {
      ApiFault apiFault = (ApiFault) th;
      return apiFault.getExceptionCode().name() + " - "
          + apiFault.getExceptionMessage();
    } else if (th.getCause() instanceof ApiFault) {
      ApiFault apiFault = (ApiFault) th.getCause();
      return apiFault.getExceptionCode().name() + " - "
          + apiFault.getExceptionMessage();
    } else {
      return ForceExceptionUtils.getStrippedRootCauseMessage(th);
    }
  }
View Full Code Here


    public static boolean isInsufficientPermissionsException(Throwable th) {
        Throwable cause = ForceExceptionUtils.getRootCause(th);
        if (th instanceof InsufficientPermissionsException || cause instanceof InsufficientPermissionsException) {
            return true;
        } else if (cause instanceof ApiFault) {
            ApiFault apiFaultCause = (ApiFault) cause;
            if (Utils.isEqual(StatusCode.INVALID_ACCESS_LEVEL.toString(), apiFaultCause.getExceptionCode().toString())
                    || isOrgBasedInsufficientPermissionsException(apiFaultCause)) {
                return true;
            } else if (Utils.isEqual(StatusCode.INVALID_TYPE.toString(), apiFaultCause.getExceptionCode().toString())
                    && Utils.isNotEmpty(apiFaultCause.getExceptionMessage())
                    && (apiFaultCause.getExceptionMessage().contains("'" + SoqlEnum.INSTALL_PACKAGE_OBJECT + "'")
                            || apiFaultCause.getExceptionMessage().contains("'" + SoqlEnum.DEVELOPMENT_PACKAGE_OBJECT+ "'"))) {
                return true;
            }
        }
        else if (Utils.isNotEmpty(cause.getMessage())
                && cause.getMessage().startsWith(FaultCode.INSUFFICIENT_ACCESS.toString())) {
View Full Code Here

    }

    public static boolean isApiUnknownException(ConnectionException e) {
        Throwable cause = ForceExceptionUtils.getRootCause(e);
        if (cause instanceof ApiFault) {
            ApiFault apiFaultCause = (ApiFault) cause;
            if (Utils.isEqual(StatusCode.UNKNOWN_EXCEPTION.toString(), apiFaultCause.getExceptionCode().toString())) {
                return true;
            }
        }

        return false;
View Full Code Here

    public static void throwNewApiUnknownException(Connection connection, ConnectionException e)
            throws ForceRemoteException {
        Throwable cause = ForceExceptionUtils.getRootCause(e);
        if (cause instanceof ApiFault) {
            ApiFault apiFaultCause = (ApiFault) cause;
            String message = getStrippedExceptionMessage(apiFaultCause.getExceptionMessage());
            message = Messages.getString("General.ApiUnknownException.message", new String[] { message });
            throw new ForceRemoteException(message, connection);
        }
    throw new ForceRemoteException(e, connection);
    }
View Full Code Here

TOP

Related Classes of com.sforce.soap.partner.fault.wsc.ApiFault

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.