Is it possible to catch reports from Operators in a Python script?
For example, the Operator bpy.ops.object.modifier_apply() shows errors in the console when something goes wrong. I'd be happy to have a try... catch... method to handle those.
Same with some addons like 3D Print Toolbox who send back useful info in the console and UI, but I can't seem to find a way to catch those. Is this possible?
Update:
To give a concrete example, this file uses a boolean modifier on two objects and when applied, the Operator returns a lot of WARNING or errors in the console. How could I catch those?
try... catch, but if I could somehow access those reports, that would be useful. – xuv Jan 15 '16 at 00:31res = bpy.ops.some_operator(). Common values are{'FINISHED'},{'CANCELED'}and{'RUNNING_MODAL'}, among others. – TLousky Jan 15 '16 at 00:33report()function from those Operators. For a particular and specific example, in the 3D Print Toolbox addon, at line 477, theOperator.report()function is called. That's what I'm trying to catch. – xuv Jan 15 '16 at 00:56try:... except:...around thebpy.ops.modifier_apply()does not work for me. The error is returned but the except is not called. – xuv Jan 15 '16 at 16:33