Skip to content

Commit

Permalink
代码优化
Browse files Browse the repository at this point in the history
  • Loading branch information
keroroqingwa committed May 26, 2020
1 parent ad1501d commit 1d81ed2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Cat.Web/Backstage.Api/Utils/CatExceptionFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ private void HandleAndWrapException(ExceptionContext context)
{
sb.Append(context.Exception.Message);
}
errInfo.Code = -1;

if (context.Exception is UserFriendlyException == false)
errInfo.Code = -1;

ContentResult content = new ContentResult();
content.Content = JsonConvert.SerializeObject(ActionRes.Fail(-1, sb.ToString(), errInfo), new JsonSerializerSettings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ private void HandleAndWrapException(ExceptionContext context)
{
sb.Append(context.Exception.Message);
}
errInfo.Code = -1;

if (context.Exception is UserFriendlyException == false)
errInfo.Code = -1;

ContentResult content = new ContentResult();
content.Content = JsonConvert.SerializeObject(ActionRes.Fail(-1, sb.ToString(), errInfo), new JsonSerializerSettings
Expand Down

0 comments on commit 1d81ed2

Please sign in to comment.