I have some trigger logic, which prevents Account to be deleted under specific circumstances. This part works. However when user tries to delete Account via GUI, Salesforce displays really ugly and confusing alert: "There's a problem saving this record. You might not have permission to edit it, or it might have been deleted or archived. Contact your administrator for help."
It should display exception message instead. From my experience it usually does. Why not in this case? Did I miss some setting? I'll be grateful for any hint or explanation.
EDIT:
if(String.IsEmpty(acc.NavisionId__c))
{
//irrelevant logic
}
else
{
throw new MyCustomInvalidOperationException('You cannot delete Account which has already become a customer and is linked to Navision. You can however change its Status to Former Customer instead');
}