de2bd2f9
“wangming”
项目初始化
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
using NCC.Dependency;
using Microsoft.AspNetCore.Http;
namespace NCC.FriendlyException
{
/// <summary>
/// 异常拓展
/// </summary>
[SuppressSniffer]
public static class AppFriendlyExceptionExtensions
{
/// <summary>
/// 设置异常状态码
/// </summary>
/// <param name="exception"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public static AppFriendlyException StatusCode(this AppFriendlyException exception, int statusCode = StatusCodes.Status500InternalServerError)
{
exception.StatusCode = statusCode;
return exception;
}
}
}
|