Table of Contents

Class ApiException

Namespace
Tudormobile.OpenTrivia
Assembly
Tudormobile.OpenTrivia.dll

Represents errors that occur when an API request fails or returns an unexpected response.

public class ApiException : Exception, ISerializable
Inheritance
ApiException
Implements
Inherited Members

Remarks

Use this exception to handle failures related to API operations, such as invalid responses, connectivity issues, or unexpected status codes. This exception is typically thrown by methods interacting with external APIs to signal that the operation could not be completed successfully.

Constructors

ApiException()

Initializes a new instance of the ApiException class.

public ApiException()

ApiException(string)

Initializes a new instance of the ApiException class with a specified error message.

public ApiException(string message)

Parameters

message string

The message that describes the error.

ApiException(string, Exception)

Initializes a new instance of the ApiException class with a specified error message and a reference to the inner exception that is the cause of this exception.

public ApiException(string message, Exception inner)

Parameters

message string

The error message that explains the reason for the exception.

inner Exception

The exception that is the cause of the current exception, or null if no inner exception is specified.