Troubleshooting BPM C# with popups?

Perhaps something ala:

try
{
//some code you expect might fail
}
catch
{
//BPM message box code here
}

Another option is using code to write directly to the server event log.
Ice.Diagnostics.Log.WriteEntry(msg)