public static IExceptionHandler GetExceptionHandler(Exception exception)
 {
     if (exception is PostgresException pgException)
     {
         var dbExcpn = new InterneuronDBException(npgEx: pgException);
         return(new InterneuronDBExceptionHandler(dbExcpn));
     }
     else if (exception is InterneuronDBException dBException)
     {
         return(new InterneuronDBExceptionHandler(dBException));
     }
     else if (exception is InterneuronBusinessException apiException)
     {
         return(new InterneuronAPIExceptionHandler(apiException));
     }
     else if (exception is Exception ex)
     {
         return(new InterneuronGenericExceptionHandler(ex));
     }
     return(new InterneuronGenericExceptionHandler(exception));
 }
Ejemplo n.º 2
0
 public InterneuronDBExceptionHandler(InterneuronDBException dbEx)
 {
     this.dbEx = dbEx;
 }