UTIL_Exceptions
Class · Group: Utilities
Learn it: Utilities guide
apex
global inherited sharing class UTIL_ExceptionsCentralised 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
| Class | Description |
|---|---|
| ConfigurationException | Thrown when required platform configuration is absent or malformed. |
| IllegalStateException | Thrown when an operation is attempted on an object whose internal state does not support that operation. |
| MaskingBlockedException | Thrown when a masking rule configured with FailureAction__c = BlockDml fails. |
| NotFoundException | Thrown when a lookup for a specific record or resource yields no results. |
| PermanentFailureException | Throw this from your own outbound handler code to say the failure is permanent: sending the same request again cannot help. |
| RequestRefusedException | Throw 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. |