Avoid Return Statements In try/catch Finally Blocks

< 1 min read

Impact area

Manageability

Severity

high

Affected element

Salesforce

Apex Class

Rule ID #

SF-AVOID-RETURN-FINALLY

Impact

Return statements in try/catch finally blocks are always executed so any exception raised before is ignored.

Remediation #

Remove return statement in try/catch finally and review your error handling logic.

Time to fix

30 min

Updated on March 21, 2025
Table of contents
Was it helpful ?