Browse Source
Merge pull request #19872 from abpframework/bug/audit-log-exceptions
Audit log exception check added
pull/19873/head
Enis Necipoglu
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
10 additions and
4 deletions
-
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Auditing/AbpAuditActionFilter.cs
-
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Auditing/AbpAuditPageFilter.cs
|
|
|
@ -29,14 +29,17 @@ public class AbpAuditActionFilter : IAsyncActionFilter, IAbpFilter, ITransientDe |
|
|
|
{ |
|
|
|
var result = await next(); |
|
|
|
|
|
|
|
if (result.Exception != null && !result.ExceptionHandled) |
|
|
|
if (result.Exception != null && !auditLog!.Exceptions.Contains(result.Exception)) |
|
|
|
{ |
|
|
|
auditLog!.Exceptions.Add(result.Exception); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
auditLog!.Exceptions.Add(ex); |
|
|
|
if (!auditLog!.Exceptions.Contains(ex)) |
|
|
|
{ |
|
|
|
auditLog!.Exceptions.Add(ex); |
|
|
|
} |
|
|
|
throw; |
|
|
|
} |
|
|
|
finally |
|
|
|
|
|
|
|
@ -34,14 +34,17 @@ public class AbpAuditPageFilter : IAsyncPageFilter, IAbpFilter, ITransientDepend |
|
|
|
{ |
|
|
|
var result = await next(); |
|
|
|
|
|
|
|
if (result.Exception != null && !result.ExceptionHandled) |
|
|
|
if (result.Exception != null && !auditLog!.Exceptions.Contains(result.Exception)) |
|
|
|
{ |
|
|
|
auditLog!.Exceptions.Add(result.Exception); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
auditLog!.Exceptions.Add(ex); |
|
|
|
if (!auditLog!.Exceptions.Contains(ex)) |
|
|
|
{ |
|
|
|
auditLog!.Exceptions.Add(ex); |
|
|
|
} |
|
|
|
throw; |
|
|
|
} |
|
|
|
finally |
|
|
|
|