Actually, till some time back, i was searching for a way to bypass the error page, while canceling the event in event handler. In one of our application, when user deletes a item, event handler should cancel event, set a different status (so, that item will not processed in the application anymore). And user should not get the error page, according to the user, item is deleted.
One of my friend, gave the solution in minutes. Though many of you might already know this, but i think it is worth putting in a blog. Here is the simple code, which helps us doing that,
properties.Cancel = true;
properties.Status = SPEventReceiverStatus.CancelNoError;
That's it, so simple. As most you might know that it works only in synchronous event.
Satheesh palaniswamy