Fix the following issues: https://ci-stg.openmrs.org/sonar/drilldown/issues/org.openmrs:openmrs?&rule=pmd%3AAvoidCatchingThrowable&rule_sev=CRITICAL&severity=CRITICAL