Class TorBoxException
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
messagestringThe error message.
errorCodeTorBoxErrorCodeThe TorBox-specific error code.
detailstringOptional 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
messagestringThe error message.
errorCodeTorBoxErrorCodeThe TorBox-specific error code.
detailstringOptional additional detail from the API response.
innerExceptionExceptionThe 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
ErrorCode
Gets the TorBox-specific error code associated with this exception.
public TorBoxErrorCode ErrorCode { get; }