summaryrefslogtreecommitdiffstats
path: root/SendGrid/SendGridMail/Exceptions/InvalidApiRequestException.cs
diff options
context:
space:
mode:
authorAlex Reed <alexreed@outlook.com>2014-09-01 03:16:56 +0100
committerAlex Reed <alexreed@outlook.com>2014-09-01 03:16:56 +0100
commitb6766f3d56fd72ce1ce22864efc9c267abe398c6 (patch)
treebafa70271c8cdb45df61049e5741580a7088b06f /SendGrid/SendGridMail/Exceptions/InvalidApiRequestException.cs
parent4671685b65127de3db6739f3d9a9d92174f3b327 (diff)
downloadsendgrid-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.cs19
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; }
+ }
+}