Skip to content

Commit 0ed8b9d

Browse files
committed
add descriptive messages to getProject
1 parent 081e137 commit 0ed8b9d

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/edgeml/edgeml.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,13 @@ def sendDataset(url: str, key: str, dataset: dict):
3333
#
3434

3535
def getProject(url: str, key: str):
36+
print('fetching project...')
3637
res = req.post(url + getProjectEndpoint, json = {"key": key})
37-
return res.json()
38+
if res.ok:
39+
return res.json()
40+
if res.status_code == 403:
41+
raise RuntimeError("Invalid key")
42+
raise RuntimeError(res.reason)
3843

3944
def __extractLabels(dataset):
4045
labels = dataset['labels']
@@ -166,5 +171,3 @@ def onComplete(self):
166171
if self.error:
167172
raise self.error
168173
self.__upload()
169-
170-
getDataFrames("https://app.edge-ml.org", "KVH0X0i9GIM/aP6IUPcr88iSaCRhh8uTWsnyrz5651X7fbvPFXrU/qoFCEgCVEv/xMZA4QDaNWpaeVypImfMsw==")

0 commit comments

Comments
 (0)