Using specific exception types
This commit is contained in:
parent
76b528e1d2
commit
6db3d9e645
|
|
@ -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 (
|
||||
|
|
|
|||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue