void IgnoreException( funcName? )
{
try{ funcName(); }
catch(Exception e){}
}
...
IgnoreException(
() => (
some code
)
);
interface ILogger {
void LogException(Exception ex);
}
...
void IgnoreExceptions<ExType>(Action func, ILogger logger) where ExType : Exception {
try {
func();
}
catch(ExType ex) {
logger.LogException(ex);
}
}