Re: Signal on management command exception

2020-05-15 Thread Adam Johnson
Yo-Yo Ma, Typically I've edited manage.py to handle this use case: def main(): # ... try: execute_from_command_line(sys.argv) except Exception: # whatever raise This doesn't capture programmatic calls via call_command() . But in my experience that's rarely use

Re: Signal on management command exception

2020-05-15 Thread François Freitag
Hi Yo-Yo Ma, A subset of your use case should be handled by https://code.djangoproject.com/ticket/21429 -- BaseCommand should use logging instead of custom output wrappers. I’m actively working on it and hope to have it ready for Django 3.2. It allows configuring the reporting of exceptions for b

Signal on management command exception

2020-05-15 Thread Yo-Yo Ma
Request exceptions have always been easy to manage, because you can use middleware, and there is the built-in signal: https://docs.djangoproject.com/en/3.0/ref/signals/#got-request-exception Problem: However, if you want to send data to e.g., Sentry or perform some other action (logging, etc.)