sonar fix:remove the declaration of exceptions from method body