Table of Contents

Class TwilioMailException

Namespace
NuvTools.Notification.Mail.Twilio
Assembly
NuvTools.Notification.Mail.Twilio.dll

Represents an error returned by the Twilio Email API.

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

Remarks

Twilio validates the whole payload before sending, returning as many issues as possible in a single response. The raw response body is preserved in ResponseContent so the validation details are not lost.

Constructors

TwilioMailException(HttpStatusCode, string?)

Initializes a new instance of the TwilioMailException class.

public TwilioMailException(HttpStatusCode statusCode, string? responseContent)

Parameters

statusCode HttpStatusCode

The HTTP status code returned by the API.

responseContent string

The raw response body returned by the API.

TwilioMailException(string)

Initializes a new instance of the TwilioMailException class with a custom message.

public TwilioMailException(string message)

Parameters

message string

The message that describes the error.

TwilioMailException(string, Exception)

Initializes a new instance of the TwilioMailException class with a custom message and inner exception.

public TwilioMailException(string message, Exception innerException)

Parameters

message string

The message that describes the error.

innerException Exception

The exception that caused the current exception.

Properties

ResponseContent

Gets the raw response body returned by the API, when available.

public string? ResponseContent { get; }

Property Value

string

StatusCode

Gets the HTTP status code returned by the API, when available.

public HttpStatusCode? StatusCode { get; }

Property Value

HttpStatusCode?