Avoid return statements in try/catch finally blocks

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

What's here


Related content

Apex Page rules

Salesforce rules




Last modified on Oct 30, 2023