How to avoid runtime error when calling an operator from a handler or another operator if the called operator has self.report({'ERROR'})

I’m trying to call an operator that has a self.report() from both a handler and another operator. It all runs smoothly until it returns to the calling code, at which point it triggers a runtime error and the message is not displayed to the user. removing the self.report works, but then I have no way of informing the user of problems they need to manually resolve.

Is there a way to call an operator which uses self.report, from either a handler or another operator without getting the runtime error?

Here’s a small example code: open a blend file and change frame to test the handler, ctrl shift f will let you run it from a popup menu.

https://www.dropbox.com/s/k2tef36289mftsk/helpme.rar?dl=1

The only areas of interest are the init file, the operator folder, and the handler folder. Everything else is just to automate class registration or unrelated to the problem.

Having a smaller example that shows the issue would be a good idea. I tried to enable your addon but get this error:

1 Like

Hi Paul, thanks for taking a look. I’ve actually found a workaround now of not using self.report, but instead using popups. I’d still be interested in a proper solution though, so I’ve re-uploaded (I’d accidentally named the file TEST.PY instead of TEST.py)