Fix to not sending stack dumps in development environment
This commit is contained in:
parent
ea4d7693ef
commit
abd6ad0a64
@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
import logging.handlers
|
import logging.handlers
|
||||||
import stackprinter
|
import os
|
||||||
|
import stackprinter # type: ignore
|
||||||
import sys
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
@ -75,7 +76,7 @@ def log_uncaught_exceptions(_ex_cls, ex, tb):
|
|||||||
logging.critical(''.join(traceback.format_tb(tb)))
|
logging.critical(''.join(traceback.format_tb(tb)))
|
||||||
print("\033[1;37;40m")
|
print("\033[1;37;40m")
|
||||||
print(stackprinter.format(ex, style="darkbg2", add_summary=True))
|
print(stackprinter.format(ex, style="darkbg2", add_summary=True))
|
||||||
if os.environ("MM_ENV") != "DEVELOPMENT":
|
if os.environ["MM_ENV"] != "DEVELOPMENT":
|
||||||
msg = stackprinter.format(ex)
|
msg = stackprinter.format(ex)
|
||||||
send_mail(Config.ERRORS_TO, Config.ERRORS_FROM,
|
send_mail(Config.ERRORS_TO, Config.ERRORS_FROM,
|
||||||
"Exception from musicmuster", msg)
|
"Exception from musicmuster", msg)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user