---
title: Avoid Catch Block With Just Logs
description: "**Impact area** Manageability **Severity** Medium **Affected element** Apex Page ## Rule ID **SF-JUST-LOG-CATCH** ## Impact Catch blocks without code will cause exceptions to be caught without any action ## Remediation Explicitly handle any exceptions caught Non compliant code: } catch(System.CalloutException…"
url: "https://community-staging.qualityclouds.com/qcdocs/qcr/rules/avoid-catch-block-with-just-logs/"
updated: "2025-03-21"
category: Rules
---

# Avoid Catch Block With Just Logs

**Impact area**

Manageability

**Severity**

Medium

**Affected element**

Apex Page

## Rule ID

**SF-JUST-LOG-CATCH**

## Impact

Catch blocks without code will cause exceptions to be caught without any action

## Remediation

Explicitly handle any exceptions caught

Non compliant code:

} catch(System.CalloutException e) {
        System.debug('ERROR:' + e);
 }

Compliant code:

} catch(Exception ex){
      System.debug('ERROR:' + e);
      return '{"error": "' + ex.getMessage() + '"}';
}

### Time to fix

30 min
