|
@@ -1,4 +1,5 @@
|
|
using System;
|
|
using System;
|
|
|
|
+using System.Net;
|
|
using Library;
|
|
using Library;
|
|
using Microsoft.AspNetCore.Mvc.Filters;
|
|
using Microsoft.AspNetCore.Mvc.Filters;
|
|
|
|
|
|
@@ -11,6 +12,8 @@ namespace MySystem
|
|
string Message = context.Exception.Message;
|
|
string Message = context.Exception.Message;
|
|
string StackTrace = context.Exception.StackTrace;
|
|
string StackTrace = context.Exception.StackTrace;
|
|
function.WriteLog(DateTime.Now.ToString() + "\r\n" + Message + "\r\n" + StackTrace, "Global全局异常处理日志");
|
|
function.WriteLog(DateTime.Now.ToString() + "\r\n" + Message + "\r\n" + StackTrace, "Global全局异常处理日志");
|
|
|
|
+ context.HttpContext.Response.StatusCode = (int)HttpStatusCode.InternalServerError;
|
|
|
|
+ context.ExceptionHandled = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|