Skip to content

Commit

Permalink
add quote issue
Browse files Browse the repository at this point in the history
  • Loading branch information
chuongmep committed Jun 11, 2024
1 parent 6406627 commit 64672a2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions APSToolkitPython/src/aps_toolkit/Derivative.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import zipfile
from json import loads as json_loads
from typing import List
from urllib.parse import unquote, quote, urljoin
from urllib.parse import unquote
import re
from os.path import join, normpath
import os
Expand Down Expand Up @@ -86,7 +86,10 @@ def check_job_status(self):
"region": self.region
}
response = requests.get(url, headers=headers)
return response.json()
if response.status_code == 404:
raise Exception(response.content)
json_response = response.json()
return json_response

def read_svf_manifest_items(self) -> List[ManifestItem]:
"""
Expand All @@ -109,7 +112,7 @@ def read_svf_manifest_items(self) -> List[ManifestItem]:
raise Exception(response.content)
json_response = response.json()
if "derivatives" not in json_response:
raise Exception("No derivatives found in the manifest.")
raise Exception(f"the manifest not found, recheck authentication or translate job.\nReason: {response.reason}")
children = json_response['derivatives'][0]["children"]
manifest_items = []
image_items = []
Expand Down

0 comments on commit 64672a2

Please sign in to comment.