Skip to content

UTIL_Exceptions ​

Class · Group: Utilities

Learn it: Utilities guide

apex
global inherited sharing class UTIL_Exceptions

Centralised container for framework-specific exception types. Groups related exception classes under a single outer class to minimise top-level file count while keeping each exception independently referenceable.

Example

apex
if(config == null)
{
    throw new UTIL_Exceptions.ConfigurationException('Missing required configuration.');
}

Inner Classes ​

ClassDescription
ConfigurationExceptionThrown when required platform configuration is absent or malformed.
IllegalStateExceptionThrown when an operation is attempted on an object whose internal state does not support that operation.
MaskingBlockedExceptionThrown when a masking rule configured with FailureAction__c = BlockDml fails.
NotFoundExceptionThrown when a lookup for a specific record or resource yields no results.
PermanentFailureExceptionThrow this from your own outbound handler code to say the failure is permanent: sending the same request again cannot help.
RequestRefusedExceptionThrow this from parseResponse() when the external system answered with a success status but its body says it refused the request, for example an order answered 200 with status REJECTED.