summaryrefslogtreecommitdiffstats
path: root/SendGrid/SendGridMail/Exceptions/InvalidApiRequestException.cs
diff options
context:
space:
mode:
authorBrandon West <brawest@gmail.com>2014-10-09 14:36:25 -0600
committerBrandon West <brawest@gmail.com>2014-10-09 14:36:25 -0600
commit5155ba90dc9046039162ab97358dbffd4bf0c1bf (patch)
tree496726994f0b01b84c9ac3523db9657b8e714d23 /SendGrid/SendGridMail/Exceptions/InvalidApiRequestException.cs
parentd9a3ace4faefa9222c64db0f549285767209e8a6 (diff)
parent059f2cec5ef1e85183dab640e571786d90887573 (diff)
downloadsendgrid-csharp-5155ba90dc9046039162ab97358dbffd4bf0c1bf.zip
sendgrid-csharp-5155ba90dc9046039162ab97358dbffd4bf0c1bf.tar.gz
sendgrid-csharp-5155ba90dc9046039162ab97358dbffd4bf0c1bf.tar.bz2
merge
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; }
+ }
+}