diff options
author | Brandon West <brawest@gmail.com> | 2013-01-10 13:40:31 -0700 |
---|---|---|
committer | Brandon West <brawest@gmail.com> | 2013-01-10 13:40:31 -0700 |
commit | 8db29e02453275717680ca58202cef4acf9ca61e (patch) | |
tree | 3a819bb2ebead49b060e8e729206ad3a83af1e96 | |
parent | 018955ce2bbc9dfa9f2b00744c33bc9442d0df72 (diff) | |
download | sendgrid-csharp-8db29e02453275717680ca58202cef4acf9ca61e.zip sendgrid-csharp-8db29e02453275717680ca58202cef4acf9ca61e.tar.gz sendgrid-csharp-8db29e02453275717680ca58202cef4acf9ca61e.tar.bz2 |
change web.CheckForErrors to handle response from mail.send
-rw-r--r--[-rwxr-xr-x] | SendGrid/Example/Example.csproj | 24 | ||||
-rwxr-xr-x | SendGrid/SendGridMail/Transport/Web.cs | 6 |
2 files changed, 17 insertions, 13 deletions
diff --git a/SendGrid/Example/Example.csproj b/SendGrid/Example/Example.csproj index 1f85cc2..6527d35 100755..100644 --- a/SendGrid/Example/Example.csproj +++ b/SendGrid/Example/Example.csproj @@ -10,16 +10,13 @@ <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Example</RootNamespace>
<AssemblyName>Example</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <TargetFrameworkProfile>
- </TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
- <DebugSymbols>true</DebugSymbols>
+ <DebugSymbols>True</DebugSymbols>
<DebugType>full</DebugType>
- <Optimize>false</Optimize>
+ <Optimize>False</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
@@ -28,7 +25,7 @@ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
+ <Optimize>True</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
@@ -43,6 +40,9 @@ <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
+ <Reference Include="CodeScales.Http">
+ <HintPath>..\SendGridMail\bin\Release\CodeScales.Http.dll</HintPath>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
@@ -51,12 +51,6 @@ <Compile Include="SMTPAPI.cs" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\SendGridMail\Mail.csproj">
- <Project>{3C687BEF-FF50-44AD-8315-2D4237281AF8}</Project>
- <Name>Mail</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
<None Include="app.config">
<SubType>Designer</SubType>
</None>
@@ -69,4 +63,10 @@ <Target Name="AfterBuild">
</Target>
-->
+ <ItemGroup>
+ <ProjectReference Include="..\SendGridMail\Mail.csproj">
+ <Project>{3C687BEF-FF50-44AD-8315-2D4237281AF8}</Project>
+ <Name>Mail</Name>
+ </ProjectReference>
+ </ItemGroup>
</Project>
\ No newline at end of file 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:
|