How to overrule Craft error messages with custom setError()? I know I can set errors and notices in the CP with setError() and setNotice().
But it gets overruled by the default error message in my event.

I have a beforeDeleteEntry event which stops the deleting of an entry by using $event-&gt;performAction = false;. This makes Craft display a default error "can't delete entry". I'd like to add more to that error or show another one, but using setError() does not work. A setNotice() is shown however so I suppose the error gets replaced by the default Craft error.

Can I do something about that?
I recently asked P&amp;T about a similar issue, although it was for the onBeforeSaveEntry event (not onBeforeDeleteEntry) -- it turns out that you need to set the error on a specific field, not the entry as a whole. I don't know if this is the case for your problem, but perhaps worth trying something like this:

$event-&gt;params['entry']-&gt;addError('title', 'Cannot delete because blah blah blah');