Suppress Debugger Exception dialog when debugging IronPython

Hi - how do you prevent the Debugger Exception dialog appearing when encountering an error whilst debugging an IronPython script? I would have expected that the DebuggerErrorOccurred event of the ScriptDebugger object would trigger, allowing me to manually handle exceptions.

I have changed the debugger.Options.BreakOnExceptions and debugger.Options.BreakOnUnhandledExceptions properties, but all they seem to do is change the checkbox status on the Debugger Exception dialog.

Cheers,

John

Hi Sirokai,

If you need custom logic when exceptions occur in a debugging UI, you can achieve this by creating a class derived from DebuggerUIController and overriding the OnException method.
I’ve attached a sample project demonstrating this approach.

Please let me know if this is what you’re looking for.

Regards,

Andrew

Thanks for that. How do I implement that if I don’t have a tab control and are using single editor mode?

The tab control shouldn’t be required for suppressing the dialog; it’s only a UI host detail. Subclass DebuggerUIController, override OnException, and avoid calling the base implementation (or mark the exception handled if the event args support it). Then make sure your single-editor setup uses that custom controller instead of the default one. If you’re currently letting the debugger create its UI internally, instantiate your custom controller explicitly and pass your single editor/document host to it. How are you creating the debugger UI at the moment?