You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
550 B
25 lines
550 B
3 years ago
|
using System;
|
||
|
using System.Linq;
|
||
|
using Volo.Abp.Collections;
|
||
|
|
||
|
namespace Sanhe.Abp.ExceptionHandling;
|
||
|
|
||
|
public class AbpExceptionHandlingOptions
|
||
|
{
|
||
|
public ITypeList<Exception> Handlers { get; }
|
||
|
|
||
|
public AbpExceptionHandlingOptions()
|
||
|
{
|
||
|
Handlers = new TypeList<Exception>();
|
||
|
}
|
||
|
|
||
|
public bool HasNotifierError(Exception ex)
|
||
|
{
|
||
|
if (typeof(IHasNotifierErrorMessage).IsAssignableFrom(ex.GetType()))
|
||
|
{
|
||
|
return true;
|
||
|
}
|
||
|
return Handlers.Any(x => x.IsAssignableFrom(ex.GetType()));
|
||
|
}
|
||
|
}
|