Exemple #1
0
 public void OrThrow(ExceptionFactoryDelegate ExceptionFactory)
 {
     try
     {
         action();
     }
     catch (Exception ex)
     {
         Logger.Log(ComponentID, ComponentName, MethodName, LogLevels.Error, ExceptionFormatter.Format(ex));
         throw ExceptionFactory(ex, ComponentID, ComponentName, MethodName);
     }
 }
Exemple #2
0
 public async Task <T> OrThrow(ExceptionFactoryDelegate ExceptionFactory)
 {
     try
     {
         return(await function);
     }
     catch (Exception ex)
     {
         Logger.Log(ComponentID, ComponentName, MethodName, LogLevels.Error, ExceptionFormatter.Format(ex));
         throw ExceptionFactory(ex, ComponentID, ComponentName, MethodName);
     }
 }