mirror of
https://github.com/Steffo99/greed.git
synced 2024-11-24 14:54:18 +00:00
#46: Don't crash if Sentry is enabled and greed isn't being run in a git repository
This commit is contained in:
parent
45eadb74b2
commit
1523863fed
1 changed files with 6 additions and 2 deletions
8
utils.py
8
utils.py
|
@ -17,9 +17,13 @@ except ModuleNotFoundError:
|
||||||
if config["Error Reporting"]["sentry_token"] != \
|
if config["Error Reporting"]["sentry_token"] != \
|
||||||
"https://00000000000000000000000000000000:00000000000000000000000000000000@sentry.io/0000000":
|
"https://00000000000000000000000000000000:00000000000000000000000000000000@sentry.io/0000000":
|
||||||
import raven
|
import raven
|
||||||
|
import raven.exceptions
|
||||||
|
try:
|
||||||
|
release = raven.fetch_git_sha(os.path.dirname(__file__))
|
||||||
|
except raven.exceptions.InvalidGitRepository:
|
||||||
|
release = "Unknown"
|
||||||
sentry_client = raven.Client(config["Error Reporting"]["sentry_token"],
|
sentry_client = raven.Client(config["Error Reporting"]["sentry_token"],
|
||||||
release=raven.fetch_git_sha(os.path.dirname(__file__)),
|
release=release,
|
||||||
environment="Dev" if __debug__ else "Prod")
|
environment="Dev" if __debug__ else "Prod")
|
||||||
else:
|
else:
|
||||||
sentry_client = None
|
sentry_client = None
|
||||||
|
|
Loading…
Reference in a new issue