@@ -75,31 +75,23 @@ def handle_errors(self, status: cs3status.Status, operation: str, msg: str = Non
7575
7676 if status .code == cs3code .CODE_FAILED_PRECONDITION or status .code == cs3code .CODE_ABORTED :
7777 self ._log_precondition_info (status , operation , status_message , msg )
78- raise FileLockedException (f'Failed precondition: operation="{ operation } " '
79- f'status_code="{ status .code } " message="{ status .message } "' )
78+ raise FileLockedException
8079 if status .code == cs3code .CODE_ALREADY_EXISTS :
8180 self ._log_already_exists (status , operation , status_message , msg )
82- raise AlreadyExistsException (f'Resource already exists: operation="{ operation } " '
83- f'status_code="{ status .code } " message="{ status .message } "' )
81+ raise AlreadyExistsException
8482 if status .code == cs3code .CODE_UNIMPLEMENTED :
8583 self ._log .info (f'msg="Invoked { operation } on unimplemented feature" ' )
86- raise UnimplementedException (f'Unimplemented feature: operation="{ operation } " '
87- f'status_code="{ status .code } " message="{ status .message } "' )
84+ raise UnimplementedException
8885 if status .code == cs3code .CODE_NOT_FOUND :
8986 self ._log_not_found_info (status , operation , status_message , msg )
90- raise NotFoundException (f'Not found: operation="{ operation } " '
91- f'status_code="{ status .code } " message="{ status .message } "' )
87+ raise NotFoundException
9288 if status .code == cs3code .CODE_UNAUTHENTICATED :
9389 self ._log_authentication_error (status , operation , status_message , msg )
94- raise AuthenticationException (f'Operation not permitted: operation="{ operation } " '
95- f'status_code="{ status .code } " message="{ status .message } "' )
90+ raise AuthenticationException
9691 if status .code != cs3code .CODE_OK :
9792 if "path not found" in str (status .message ).lower ():
9893 self ._log .info (f'msg="Invoked { operation } on missing file" ' )
99- raise NotFoundException (
100- message = f'No such file or directory: operation="{ operation } " '
101- f'status_code="{ status .code } " message="{ status .message } "'
102- )
94+ raise NotFoundException
10395 self ._log_unknown_error (status , operation , status_message , msg )
10496 raise UnknownException (f'Unknown Error: operation="{ operation } " status_code="{ status .code } " '
10597 f'message="{ status .message } "' )
0 commit comments