How do I make Django signal handlers not fail silently when an exception is encountered in the handler?
Is there a place where all these errors are logged while using development server?
Why do django signal handlers fail silently anyway? Isn't it against one of the lines in Zen of Python?
Zen of Python clearly states...
Errors should never pass silently.
It makes them a nightmare to debug. All you can see is that the signal is not getting fired...
I found this question but the answer is useless to me as it is very specific to the question (answer suggests using pyflakes, I already use pydev which does satisfactory static analysis)
There are two ways to send signals in Django. To send a signal, call either Signal. send() (all built-in signals use this) or Signal. send_robust() .
To answer directly: No. It's sync.
Django Signals - post_delete()To notify another part of the application after the delete event of an object happens, you can use the post_delete signal.
Yes, I think like you: errors should never fail silently
Django's built in signals don't fail silently because they use send()
send_robust()
ignores exceptionsDocs from send_robust()
send_robust() catches all errors derived from Python’s Exception class, and ensures all receivers are notified of the signal. If an error occurs, the error instance is returned in the tuple pair for the receiver that raised the error.
Since django doesn't use send_robust()
please investigate where it gets called. I guess it is in your source code, or in the code of a third party app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With