Class TwilioMailException
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
statusCodeHttpStatusCodeThe HTTP status code returned by the API.
responseContentstringThe 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
messagestringThe 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
messagestringThe message that describes the error.
innerExceptionExceptionThe 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
StatusCode
Gets the HTTP status code returned by the API, when available.
public HttpStatusCode? StatusCode { get; }