-
Notifications
You must be signed in to change notification settings - Fork 9.9k
/
HttpSysException.cs
41 lines (35 loc) · 1.02 KB
/
HttpSysException.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
namespace Microsoft.AspNetCore.Server.HttpSys;
/// <summary>
/// Exception thrown by HttpSys when an error occurs
/// </summary>
[SuppressMessage("Microsoft.Usage", "CA2237:MarkISerializableTypesWithSerializable")]
public class HttpSysException : Win32Exception
{
internal HttpSysException()
: base(Marshal.GetLastWin32Error())
{
}
internal HttpSysException(int errorCode)
: base(errorCode)
{
}
internal HttpSysException(int errorCode, string message)
: base(errorCode, message)
{
}
// the base class returns the HResult with this property
// we need the Win32 Error Code, hence the override.
/// <inheritdoc />
public override int ErrorCode
{
get
{
return NativeErrorCode;
}
}
}