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;
return true;
}
throw new Exception("Malformed request");
throw new InvalidDataException("Malformed request");
}
while (

View File

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

View File

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