Skip to content

Commit 1906c42

Browse files
eeisegnagustingroh
authored andcommitted
chore:ER-108 gRPC error check for succeed with warnings
1 parent 762709b commit 1906c42

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: src/scanoss/scanossgrpc.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -388,13 +388,15 @@ def _check_status_response(self, status_response: StatusResponse, request_id: st
388388
self.print_debug(f'Checking response status (rqId: {request_id}): {status_response}')
389389
status_code: StatusCode = status_response.status
390390
if status_code > 1:
391+
ret_val = False # default to failed
391392
msg = "Unsuccessful"
392393
if status_code == 2:
393394
msg = "Succeeded with warnings"
395+
ret_val = True # No need to fail as it succeeded with warnings
394396
elif status_code == 3:
395397
msg = "Failed with warnings"
396398
self.print_stderr(f'{msg} (rqId: {request_id} - status: {status_code}): {status_response.message}')
397-
return False
399+
return ret_val
398400
return True
399401

400402
def _get_proxy_config(self):

0 commit comments

Comments
 (0)