Using specific exception types

This commit is contained in:
Louis DeJardin 2015-09-18 16:41:43 -07:00
parent 76b528e1d2
commit 6db3d9e645
3 changed files with 4 additions and 3 deletions

View File

@ -613,7 +613,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
consumed = scan; consumed = scan;
return true; return true;
} }
throw new Exception("Malformed request"); throw new InvalidDataException("Malformed request");
} }
while ( while (

View File

@ -484,7 +484,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
} }
else if (block.Next == null) else if (block.Next == null)
{ {
throw new Exception("end did not follow iterator"); throw new InvalidOperationException("end did not follow iterator");
} }
else else
{ {

View File

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Framework.Primitives; using Microsoft.Framework.Primitives;
using System.IO;
namespace Microsoft.AspNet.Server.Kestrel.Http namespace Microsoft.AspNet.Server.Kestrel.Http
{ {
@ -167,7 +168,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
} }
if (input.RemoteIntakeFin) if (input.RemoteIntakeFin)
{ {
throw new Exception("Unexpected end of request content"); throw new InvalidDataException("Unexpected end of request content");
} }
} }
} }