@@ -75,31 +75,23 @@ def handle_errors(self, status: cs3status.Status, operation: str, msg: str = Non
75
75
76
76
if status .code == cs3code .CODE_FAILED_PRECONDITION or status .code == cs3code .CODE_ABORTED :
77
77
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
80
79
if status .code == cs3code .CODE_ALREADY_EXISTS :
81
80
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
84
82
if status .code == cs3code .CODE_UNIMPLEMENTED :
85
83
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
88
85
if status .code == cs3code .CODE_NOT_FOUND :
89
86
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
92
88
if status .code == cs3code .CODE_UNAUTHENTICATED :
93
89
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
96
91
if status .code != cs3code .CODE_OK :
97
92
if "path not found" in str (status .message ).lower ():
98
93
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
103
95
self ._log_unknown_error (status , operation , status_message , msg )
104
96
raise UnknownException (f'Unknown Error: operation="{ operation } " status_code="{ status .code } " '
105
97
f'message="{ status .message } "' )
0 commit comments