pycharm-odoo icon indicating copy to clipboard operation
pycharm-odoo copied to clipboard

Have debugger break on unhandled exceptions

Open Jerther opened this issue 1 year ago • 4 comments

Hi!

I've been trying to make this work for years now, with no success. Pycharm stops fine on unhandled exceptions for projects outside Odoo, but it won't when debugging modules inside Odoo. I believe it has something to do with Odoo's way of handling exceptions so they bubble up into the UI.

For example, I cannot have Pycharm break on a line like x = 10 / 0. For years I've just fiddled with conditional break points and wasting time.

Is this something pycharm-odoo could fix?

Jerther avatar Sep 29 '23 13:09 Jerther

Hello @Jerther , This is an interesting problem. I will research to see if we can fix it.

trinhanhngoc avatar Sep 29 '23 13:09 trinhanhngoc

Hello @trinhanhngoc , any update on this possible enhancement?

Jerther avatar Mar 13 '24 14:03 Jerther

Hello @Jerther ,

I think that because these exceptions are handled by Odoo (https://github.com/odoo/odoo/blob/96e3782a146249fede5130c3e048cfdf5adadcdd/odoo/http.py#L2194), PyCharm cannot capture them by default. The information in this PyCharm blog post (https://blog.jetbrains.com/pycharm/2024/01/new-low-impact-monitoring-api-in-python-3-12) may help me figure out a solution for our problem.

trinhanhngoc avatar Mar 13 '24 14:03 trinhanhngoc

New in Python 3.12. Not sure if Odoo 15 supports it! But still good news as we'll get there eventually. :)

Jerther avatar Mar 13 '24 14:03 Jerther