Skip to content

Commit

Permalink
Merge pull request #915 from InfuseAI/bug/sc-32458/jsondecodeerror-ex…
Browse files Browse the repository at this point in the history
…pecting-value-line-1-column

[Bug] Add handler for server side error response when uploading report
  • Loading branch information
wcchang1115 authored Oct 25, 2023
2 parents 294b792 + 888c28b commit 04e6a2e
Showing 1 changed file with 7 additions and 1 deletion.
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 @@ def _upload_callback(monitor):
if show_progress:
upload_progress.stop()

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

return response_data

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

0 comments on commit 04e6a2e

Please sign in to comment.