Skip to content

Commit

Permalink
Add Sentry (#5)
Browse files Browse the repository at this point in the history
* Add Sentry logging

* Fix encoding

* Fix encoding again

* Fix encoding again
  • Loading branch information
larsenv authored Oct 4, 2020
1 parent 4c20045 commit 2e3bbda
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ requests
prompt_toolkit
pypresence
nest_asyncio
sentry_sdk
6 changes: 3 additions & 3 deletions riitag/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def __str__(self):

def download_titles(self):
if not path.exists("cache/titles.txt"):
f = open("cache/titles.txt", "w")
f.write(requests.get(TITLES_URL, headers=HEADERS).text)
f = open("cache/titles.txt", "w", encoding='utf8')
f.write(requests.get(TITLES_URL, headers=HEADERS).text.encode('utf8').decode('ascii', 'ignore'))
f.close()

def load_titles(self):
Expand Down Expand Up @@ -105,4 +105,4 @@ def fetch_riitag(self):
riitag = RiitagInfo(**data)
self.riitag = riitag

return riitag
return riitag
6 changes: 6 additions & 0 deletions start.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import os
import sentry_sdk
import sys

import nest_asyncio
Expand All @@ -15,6 +16,11 @@
import menus
from riitag import oauth2, user, watcher, presence, preferences

sentry_sdk.init(
"https://[email protected]/5450405",
traces_sample_rate=1.0
)

nest_asyncio.apply()

# Get resource when frozen with PyInstaller
Expand Down

0 comments on commit 2e3bbda

Please sign in to comment.