Skip to main content

ServiceProtectionException

  • Namespace: PPDS.Dataverse.Resilience
  • Assembly: PPDS.Dataverse
  • Kind: Class
  • Base: Exception
  • Implements: ISerializable

Summary​

Exception thrown when a service protection limit is hit.

Members​

Constructors​

ServiceProtectionException(string connectionName, TimeSpan retryAfter, int errorCode)​

ServiceProtectionException(string connectionName, TimeSpan retryAfter, int errorCode)

Initializes a new instance of the PPDS.Dataverse.Resilience.ServiceProtectionException class.

  • Param connectionName: The connection that was throttled.

  • Param retryAfter: Time to wait before retrying.

  • Param errorCode: The error code from the service.

ServiceProtectionException(string connectionName, TimeSpan retryAfter, int errorCode, Exception innerException)​

ServiceProtectionException(string connectionName, TimeSpan retryAfter, int errorCode, Exception innerException)

Initializes a new instance of the PPDS.Dataverse.Resilience.ServiceProtectionException class.

  • Param connectionName: The connection that was throttled.

  • Param retryAfter: Time to wait before retrying.

  • Param errorCode: The error code from the service.

  • Param innerException: The inner exception.

ServiceProtectionException(string message)​

ServiceProtectionException(string message)

Initializes a new instance of the PPDS.Dataverse.Resilience.ServiceProtectionException class with a custom message (used when all connections are throttled and tolerance is exceeded).

  • Param message: The exception message.

Methods​

IsServiceProtectionError​

bool IsServiceProtectionError(int errorCode)

Determines if an error code is a service protection error.

  • Param errorCode: The error code to check.

  • Returns: True if the error code indicates a service protection limit.

Properties​

ConnectionName​

string ConnectionName { get; }

Gets the name of the connection that was throttled.

ErrorCode​

int ErrorCode { get; }

Gets the error code from the service.

RetryAfter​

TimeSpan RetryAfter { get; }

Gets the time to wait before retrying.

Fields​

ErrorCodeConcurrentRequestsExceeded​

int ErrorCodeConcurrentRequestsExceeded

Error code for "Concurrent requests exceeded".

ErrorCodeExecutionTimeExceeded​

int ErrorCodeExecutionTimeExceeded

Error code for "Combined execution time exceeded".

ErrorCodeRequestsExceeded​

int ErrorCodeRequestsExceeded

Error code for "Number of requests exceeded".