diff options
author | brandonmwest <brawest@gmail.com> | 2013-01-10 12:54:29 -0800 |
---|---|---|
committer | brandonmwest <brawest@gmail.com> | 2013-01-10 12:54:29 -0800 |
commit | 52ff9277583c063a4b06165723bca2041a6aae5b (patch) | |
tree | 6041b6e3fef9242362ab1a63e9323378bb1afcc5 | |
parent | 971e416de388e58d34ea81032bcda060274d269a (diff) | |
parent | 1fc0ee044ed826bf89b32e4537b71763e83cda93 (diff) | |
download | sendgrid-csharp-52ff9277583c063a4b06165723bca2041a6aae5b.zip sendgrid-csharp-52ff9277583c063a4b06165723bca2041a6aae5b.tar.gz sendgrid-csharp-52ff9277583c063a4b06165723bca2041a6aae5b.tar.bz2 |
Merge pull request #19 from brandonmwest/master
Handled error response from mail.send properly
-rwxr-xr-x | SendGrid/SendGridMail/Transport/Web.cs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/SendGrid/SendGridMail/Transport/Web.cs b/SendGrid/SendGridMail/Transport/Web.cs index 5a27469..7015653 100755 --- a/SendGrid/SendGridMail/Transport/Web.cs +++ b/SendGrid/SendGridMail/Transport/Web.cs @@ -107,7 +107,11 @@ namespace SendGridMail.Transport case "result":
break;
case "message": // success
- return;
+ bool errors = reader.ReadToNextSibling("errors");
+ if (errors)
+ throw new ProtocolViolationException(status);
+ else
+ return;
case "error": // failure
throw new ProtocolViolationException(status);
default:
|