Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions shellfoundry/utilities/shell_package_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,23 @@ def _add_new_shell(self, client, package_full_path):
)

def _parse_installation_error(self, base_message, error):
error_str = str(error)
cs_message = error_str # Default to full error string

try:
cs_message = json.loads(str(error))["Message"]
except Exception:
cs_message = ""
# Check if it's a PackagingRestApiError with embedded JSON response
if "response:" in error_str:
# Extract JSON part after "response: "
json_start = error_str.find("response:") + len("response:")
json_str = error_str[json_start:].strip().rstrip("')")
cs_message = json.loads(json_str)["Message"]
else:
# Try to parse the error string directly as JSON
cs_message = json.loads(error_str)["Message"]
except (json.JSONDecodeError, KeyError, ValueError):
# If JSON parsing fails, keep the full error string
pass

return "{}. CloudShell responded with: '{}'".format(base_message, cs_message)

def _increase_pbar(self, pbar, time_wait):
Expand Down
Loading