Skip to content

Commit e35db05

Browse files
committed
Addressed review comments and fixed bug
1 parent 5272e49 commit e35db05

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

simvue/client.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ def get_run_id_from_name(self, name):
4949

5050
if response.status_code == 200:
5151
if 'data' in response.json():
52+
if len(response.json()['data']) == 0:
53+
raise RuntimeError("Could not collect ID - no run found with this name.")
5254
if len(response.json()['data']) > 1:
53-
raise Exception("Could not collect ID - more than one run exists with this name.")
55+
raise RuntimeError("Could not collect ID - more than one run exists with this name.")
5456
else:
55-
return response.json()['data'][0]['id']
56-
raise Exception(response.text)
57+
return response.json()['data'][0]['id']
58+
raise RuntimeError(response.text)
5759

5860
def get_run(self, run, system=False, tags=False, metadata=False):
5961
"""

0 commit comments

Comments
 (0)