Skip to content

Commit 710c8e4

Browse files
authored
add ServiceExceptionFilter
add ServiceExceptionFilter
1 parent 522d462 commit 710c8e4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using Surging.Core.CPlatform.Exceptions;
2+
using Surging.Core.CPlatform.Filters.Implementation;
3+
using System;
4+
5+
namespace Surging.Core.KestrelHttpServer
6+
{
7+
public class ServiceExceptionFilter : ExceptionFilterAttribute
8+
{
9+
public override void OnException(RpcActionExecutedContext context)
10+
{
11+
if (context.Exception is CPlatformCommunicationException)
12+
throw new Exception(context.Exception.Message, context.Exception);
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)