odoo-ide / pycharm-odoo

PyCharm plugin for Odoo
https://plugins.jetbrains.com/plugin/13499-odoo
Other
41 stars 5 forks source link

Have debugger break on unhandled exceptions #416

Open Jerther opened 9 months ago

Jerther commented 9 months ago

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?

trinhanhngoc commented 9 months ago

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

Jerther commented 3 months ago

Hello @trinhanhngoc , any update on this possible enhancement?

trinhanhngoc commented 3 months ago

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.

Jerther commented 3 months ago

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