Don't send stackdumps by mail in DEVELOPMENT environment
This commit is contained in:
parent
94b2f473e9
commit
ea4d7693ef
@ -75,9 +75,10 @@ def log_uncaught_exceptions(_ex_cls, ex, tb):
|
||||
logging.critical(''.join(traceback.format_tb(tb)))
|
||||
print("\033[1;37;40m")
|
||||
print(stackprinter.format(ex, style="darkbg2", add_summary=True))
|
||||
msg = stackprinter.format(ex)
|
||||
send_mail(Config.ERRORS_TO, Config.ERRORS_FROM,
|
||||
"Exception from musicmuster", msg)
|
||||
if os.environ("MM_ENV") != "DEVELOPMENT":
|
||||
msg = stackprinter.format(ex)
|
||||
send_mail(Config.ERRORS_TO, Config.ERRORS_FROM,
|
||||
"Exception from musicmuster", msg)
|
||||
|
||||
|
||||
sys.excepthook = log_uncaught_exceptions
|
||||
|
||||
Loading…
Reference in New Issue
Block a user