Table of Contents

Class TorBoxException

Namespace
TorBoxSDK.Models.Common
Assembly
TorBoxSDK.dll

Represents an error returned by the TorBox API.

public sealed class TorBoxException : Exception, ISerializable
Inheritance
TorBoxException
Implements
Inherited Members

Remarks

TorBoxException carries the ErrorCode and optional Detail from the API response, making it easy to handle specific failure scenarios in calling code.

Constructors

TorBoxException(string, TorBoxErrorCode, string?)

Initializes a new instance of the TorBoxException class.

public TorBoxException(string message, TorBoxErrorCode errorCode, string? detail)

Parameters

message string

The error message.

errorCode TorBoxErrorCode

The TorBox-specific error code.

detail string

Optional additional detail from the API response.

TorBoxException(string, TorBoxErrorCode, string?, Exception)

Initializes a new instance of the TorBoxException class with an inner exception.

public TorBoxException(string message, TorBoxErrorCode errorCode, string? detail, Exception innerException)

Parameters

message string

The error message.

errorCode TorBoxErrorCode

The TorBox-specific error code.

detail string

Optional additional detail from the API response.

innerException Exception

The exception that is the cause of this exception.

Properties

Detail

Gets additional detail about the error from the API response, or null if none was provided.

public string? Detail { get; }

Property Value

string

ErrorCode

Gets the TorBox-specific error code associated with this exception.

public TorBoxErrorCode ErrorCode { get; }

Property Value

TorBoxErrorCode