summaryrefslogtreecommitdiff
path: root/overlays/worktime
diff options
context:
space:
mode:
Diffstat (limited to 'overlays/worktime')
-rwxr-xr-xoverlays/worktime/worktime/__main__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/overlays/worktime/worktime/__main__.py b/overlays/worktime/worktime/__main__.py
index 5630837b..0df226fa 100755
--- a/overlays/worktime/worktime/__main__.py
+++ b/overlays/worktime/worktime/__main__.py
@@ -42,7 +42,7 @@ class TogglAPISection(Enum):
42 REPORTS = '/reports/api/v2' 42 REPORTS = '/reports/api/v2'
43 43
44class TogglAPIError(Exception): 44class TogglAPIError(Exception):
45 def __init__(self, http_error, response): 45 def __init__(self, response, *, http_error=None):
46 self.http_error = http_error 46 self.http_error = http_error
47 self.response = response 47 self.response = response
48 48
@@ -179,7 +179,7 @@ class TogglAPI(object):
179 url = self._make_url(api = TogglAPISection.TOGGL, section = ['me', 'time_entries', 'current']) 179 url = self._make_url(api = TogglAPISection.TOGGL, section = ['me', 'time_entries', 'current'])
180 r = self._query(url = url, method='GET') 180 r = self._query(url = url, method='GET')
181 181
182 if not r or not r.json(): 182 if not r or (not r.json() and r.json() is not None):
183 raise TogglAPIError(r) 183 raise TogglAPIError(r)
184 184
185 if not r.json() or not r.json()['billable']: 185 if not r.json() or not r.json()['billable']: