Table of Contents

Class MailtrapApiException

Namespace
Mailtrap.Core.Exceptions
Assembly
Mailtrap.Abstractions.dll

Generic exception with additional API call details.

public abstract class MailtrapApiException : MailtrapException, ISerializable
Inheritance
MailtrapApiException
Implements
Derived

Constructors

MailtrapApiException(Uri, HttpMethod)

Initializes a new instance of the exception with failed API details, defined by requestUri and httpMethod.

protected MailtrapApiException(Uri requestUri, HttpMethod httpMethod)

Parameters

requestUri Uri

API endpoint that thrown exception.

httpMethod HttpMethod

HTTP method that thrown exception.

Exceptions

ArgumentNullException

When the requestUri or httpMethod is null.

MailtrapApiException(Uri, HttpMethod, string)

Initializes a new instance of the exception with failed API details, defined by requestUri and httpMethod, with specified error message.

protected MailtrapApiException(Uri requestUri, HttpMethod httpMethod, string message)

Parameters

requestUri Uri
API endpoint that thrown exception.
httpMethod HttpMethod
HTTP method that thrown exception.
message string

Exceptions

ArgumentNullException

When the requestUri or httpMethod is null.

MailtrapApiException(Uri, HttpMethod, string, Exception)

Initializes a new instance of the exception with failed API details, defined by requestUri and httpMethod, with specified error message and a reference to the innerException, that is the cause of this exception.

protected MailtrapApiException(Uri requestUri, HttpMethod httpMethod, string message, Exception innerException)

Parameters

requestUri Uri
API endpoint that thrown exception.
httpMethod HttpMethod
HTTP method that thrown exception.
message string
innerException Exception

Exceptions

ArgumentNullException

When the requestUri or httpMethod is null.

Properties

HttpMethod

Gets HTTP method that thrown exception.

public HttpMethod HttpMethod { get; }

Property Value

HttpMethod

HTTP method that thrown exception.

RequestUri

Gets API endpoint that thrown exception.

public Uri RequestUri { get; }

Property Value

Uri

API endpoint that thrown exception.