mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

matthew_swift
04.12.2009 20df27fbd253139d3e5a24dd6e8063ed11dd1fab
sdk/src/org/opends/sdk/ErrorResultException.java
@@ -70,6 +70,24 @@
    // TODO: choose type of exception based on result code (e.g.
    // referral).
    if(result.getResultCode() == ResultCode.CLIENT_SIDE_SERVER_DOWN ||
        result.getResultCode() == ResultCode.CLIENT_SIDE_CONNECT_ERROR ||
        result.getResultCode() == ResultCode.CLIENT_SIDE_DECODING_ERROR ||
        result.getResultCode() == ResultCode.CLIENT_SIDE_ENCODING_ERROR)
    {
      return new ConnectionException(result);
    }
    if(result.getResultCode() == ResultCode.CLIENT_SIDE_TIMEOUT)
    {
      return new OperationTimeoutException(result);
    }
    if(result.getResultCode() == ResultCode.CLIENT_SIDE_USER_CANCELLED)
    {
      return new CancelledException(result);
    }
    return new ErrorResultException(result);
  }