graph/errorcode: Map a few more CS3 status codes

This commit is contained in:
Ralf Haferkamp
2023-11-29 10:11:12 +01:00
committed by Ralf Haferkamp
parent e63ce368ed
commit faf0e242cd
+8
View File
@@ -40,8 +40,16 @@ func FromCS3Status(status *cs3rpc.Status, ignore ...cs3rpc.Code) *Error {
err.errorCode = NameAlreadyExists
case code == cs3rpc.Code_CODE_FAILED_PRECONDITION:
err.errorCode = PreconditionFailed
case code == cs3rpc.Code_CODE_OUT_OF_RANGE:
err.errorCode = InvalidRange
case code == cs3rpc.Code_CODE_UNIMPLEMENTED:
err.errorCode = NotSupported
case code == cs3rpc.Code_CODE_UNAVAILABLE:
err.errorCode = ServiceNotAvailable
case code == cs3rpc.Code_CODE_INSUFFICIENT_STORAGE:
err.errorCode = QuotaLimitReached
case code == cs3rpc.Code_CODE_LOCKED:
err.errorCode = ItemIsLocked
}
return err