Skip to content

Commit

Permalink
fix s3 test
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoucheng361 committed May 10, 2024
1 parent 12a0b1d commit c3e34a2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/scripts/hypo/s3_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ def handleException(self, e, action, **kwargs):
return Exception(f'code:{e.code} message:{e.message}')
elif isinstance(e, subprocess.CalledProcessError):
self.logger.info(f'{action} {kwargs} failed: {e.output.decode()}')
return Exception(f'returncode:{e.returncode} output:{e.output.decode()}')
try:
output = json.loads(e.output.decode())
message = output.get('error', {}).get('message', 'error message not found')
return Exception(f'returncode:{e.returncode} {message}')
except ValueError as ve:
return Exception(f'returncode:{e.returncode} output:{e.output.decode()}')
else:
self.logger.info(f'{action} {kwargs} failed: {e}')
return e
Expand Down

0 comments on commit c3e34a2

Please sign in to comment.