# UTIL_Exceptions.MaskingBlockedException

**Class** · Group: `Data Masking`

Learn it: [Utilities guide](/utilities-guide)

<div class="apex-member apex-class">

```apex
global inherited sharing class UTIL_Exceptions.MaskingBlockedException
```

Thrown when a masking rule configured with FailureAction__c = BlockDml fails. Propagates out of UTIL_FrameworkMasker.RecordMasker.apply and (via the trigger dispatcher pre-step) the surrounding DML so the record is never persisted with sensitive data that could not be reliably redacted. Catch this type in your code to detect that the framework aborted a write because masking could not complete safely.

**Example**

```apex
try
{
    insert account;
}
catch(UTIL_Exceptions.MaskingBlockedException blocked)
{
    handleMaskingFailure(blocked);
}
```

</div>

---
