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
requestUriUriAPI endpoint that thrown exception.
httpMethodHttpMethodHTTP method that thrown exception.
Exceptions
- ArgumentNullException
When the
requestUriorhttpMethodis 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
requestUriUri- API endpoint that thrown exception.
httpMethodHttpMethod- HTTP method that thrown exception.
messagestring
Exceptions
- ArgumentNullException
When the
requestUriorhttpMethodis 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
requestUriUri- API endpoint that thrown exception.
httpMethodHttpMethod- HTTP method that thrown exception.
messagestringinnerExceptionException
Exceptions
- ArgumentNullException
When the
requestUriorhttpMethodis 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.