In my try-catch
, I want to write the exception that occurred within an object (for historical purposes, necessary for the business rule, since this section occurs in a processing via integration with external sources). >
To do this, I need to make sure in the% w_that the exception was not the database or my ORM, because if I did not give an exception within the exception ... it would be an ugly crash and pimba, system out of thin air.
So, it would look something like this:
Try {
//Cógido
}
catch (exception ex)
{
//VERIFICAR SE NÃO É UMA EXCEÇÃO DE BD (MEU CASO ENTITY FRAMEWORK)
}
Is there a possibility? How could I do this in a more generic way?