Skip to content

Commit

Permalink
Handle printing of http error codes properly
Browse files Browse the repository at this point in the history
  • Loading branch information
scottcame committed Apr 12, 2019
1 parent 92df96c commit 468c5a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fibo-subset/ddw_fibo_subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def getGraphList(self, verbose):
if (resp.status_code == 400):
raise Exception("Dataset " + self.dataset + " does not exist")
elif (resp.status_code != 200):
raise Exception("Error retrieving dataset from data.world, http status code: " + resp.status_code)
raise Exception("Error retrieving dataset from data.world, http status code: " + str(resp.status_code))

datasetInfo = resp.json()

Expand Down Expand Up @@ -108,7 +108,7 @@ def saveSubset(self, subsetData, ontologyURI, fmt, verbose, log):
print("Dataset/file " + args.seeds_dataset + "/" + args.seeds_file + " does not exist on data.world, exiting")
sys.exit(-1)
elif (resp.status_code != 200):
print("Error accessing seeds file " + args.seeds_dataset + "/" + args.seeds_file + " on data.world, http status code: " + resp.status_code)
print("Error accessing seeds file " + args.seeds_dataset + "/" + args.seeds_file + " on data.world, http status code: " + str(resp.status_code))
sys.exit(-1)

seeds = resp.text.splitlines()
Expand Down

0 comments on commit 468c5a9

Please sign in to comment.