This is kind of strange - why are you using a ``raise_error`` variable here, rather than just raising an error? If you call ``raise`` directly, your error message could also be more informative.