debug: expose whisk response details to UI error
This commit is contained in:
parent
22a374525e
commit
f336b25f13
1 changed files with 4 additions and 2 deletions
|
|
@ -246,12 +246,14 @@ def load_template_favorites():
|
||||||
if not images:
|
if not images:
|
||||||
import json
|
import json
|
||||||
logger.error(f"WHISK DEBUG - Full Response: {json.dumps(json_resp)}")
|
logger.error(f"WHISK DEBUG - Full Response: {json.dumps(json_resp)}")
|
||||||
|
debug_info = json.dumps(json_resp)
|
||||||
# check for common non-standard errors
|
# check for common non-standard errors
|
||||||
if 'error' in json_resp:
|
if 'error' in json_resp:
|
||||||
err_msg = json_resp['error']
|
err_msg = json_resp['error']
|
||||||
raise WhiskClientError(f"Whisk API returned error: {err_msg}")
|
raise WhiskClientError(f"Whisk Error: {err_msg} | Valid Cookies? Check logs.")
|
||||||
|
|
||||||
raise WhiskClientError(f"No images found in response. Response keys: {list(json_resp.keys())}")
|
# Return the full structure in the error so user can see it in UI
|
||||||
|
raise WhiskClientError(f"Whisk API returned NO IMAGES. Google says: {debug_info}")
|
||||||
|
|
||||||
return base64.b64decode(images[0])
|
return base64.b64decode(images[0])
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue