Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Add handler for server side error response when uploading report #915

Merged
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
8 changes: 7 additions & 1 deletion piperider_cli/cloud/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import os
from json import JSONDecodeError
from typing import List, Union

import requests
Expand Down Expand Up @@ -320,7 +321,12 @@
if show_progress:
upload_progress.stop()

return response.json()
try:
response_data = response.json()
except JSONDecodeError:
response_data = {"success": False, "message": response.reason}

Check warning on line 327 in piperider_cli/cloud/__init__.py

View check run for this annotation

Codecov / codecov/patch

piperider_cli/cloud/__init__.py#L324-L327

Added lines #L324 - L327 were not covered by tests

return response_data

Check warning on line 329 in piperider_cli/cloud/__init__.py

View check run for this annotation

Codecov / codecov/patch

piperider_cli/cloud/__init__.py#L329

Added line #L329 was not covered by tests

def share_run_report(self, workspace_name: str, project_name: str, run_id: int):
if not self.available:
Expand Down
Loading