diff options
author | Alex Reed <alexreed@outlook.com> | 2014-09-01 03:16:56 +0100 |
---|---|---|
committer | Alex Reed <alexreed@outlook.com> | 2014-09-01 03:16:56 +0100 |
commit | b6766f3d56fd72ce1ce22864efc9c267abe398c6 (patch) | |
tree | bafa70271c8cdb45df61049e5741580a7088b06f /SendGrid/SendGridMail/Exceptions/InvalidApiRequestException.cs | |
parent | 4671685b65127de3db6739f3d9a9d92174f3b327 (diff) | |
download | sendgrid-csharp-b6766f3d56fd72ce1ce22864efc9c267abe398c6.zip sendgrid-csharp-b6766f3d56fd72ce1ce22864efc9c267abe398c6.tar.gz sendgrid-csharp-b6766f3d56fd72ce1ce22864efc9c267abe398c6.tar.bz2 |
Added new exception catching.
Diffstat (limited to 'SendGrid/SendGridMail/Exceptions/InvalidApiRequestException.cs')
-rw-r--r-- | SendGrid/SendGridMail/Exceptions/InvalidApiRequestException.cs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/SendGrid/SendGridMail/Exceptions/InvalidApiRequestException.cs b/SendGrid/SendGridMail/Exceptions/InvalidApiRequestException.cs new file mode 100644 index 0000000..7fd51ea --- /dev/null +++ b/SendGrid/SendGridMail/Exceptions/InvalidApiRequestException.cs @@ -0,0 +1,19 @@ +using System; +using System.Net; + +namespace Exceptions +{ + public class InvalidApiRequestException : Exception + { + public InvalidApiRequestException(HttpStatusCode httpStatusCode, string[] errors, string httpResponsePhrase) + : base(httpResponsePhrase + " Check `Errors` for a list of errors returned by the API.") + { + ResponseStatusCode = httpStatusCode; + Errors = errors; + } + + public String[] Errors { get; set; } + + public HttpStatusCode ResponseStatusCode { get; private set; } + } +} |