Fixed sonar critical violations - Avoid Catching Throwable