# Why do (bgl) exceptions in modal crash blender

No matter what I type into the console, or execute from the text buffer, blender shows an error but continues on as usual. However, I recently noticed that many exceptions (involving bgl callbacks) make blender crash if they happen inside the modal operator.

Why is that?

• care to elaborate on the code in the modal function? bgl callbacks? – zeffii Apr 26 '15 at 7:41

The modal part of your operator needs to return something each time it's called, in the case of an exception that is probably return {'CANCELLED'}. Most exceptions are not fatal, but exceptions in bgl callbacks can be.