mirror of
https://github.com/versity/versitygw.git
synced 2026-09-23 08:24:17 +00:00
rdma: map RC transport errors to protocol codes
Classify the rejected-argument, short-transfer, and oversized- value failures of the session server as bad requests at the route boundary, answering the closest S3-style protocol error instead of a generic internal failure.
This commit is contained in:
@@ -40,10 +40,15 @@ func (errRouteUnavailable) Error() string {
|
||||
}
|
||||
|
||||
// isRouteBadRequest reports whether err is a malformed-request
|
||||
// class error from the Linux route handlers.
|
||||
// class error: an invalid header value from the route handlers or
|
||||
// a rejected argument, short transfer, or oversized value from
|
||||
// the session server.
|
||||
func isRouteBadRequest(err error) bool {
|
||||
var bad errRouteBadRequest
|
||||
return errors.As(err, &bad)
|
||||
return errors.As(err, &bad) ||
|
||||
errors.Is(err, rcserver.ErrShort) ||
|
||||
errors.Is(err, rcserver.ErrTrunc) ||
|
||||
errors.Is(err, rcserver.ErrArg)
|
||||
}
|
||||
|
||||
// isRouteNotFound reports whether err identifies an unknown or
|
||||
|
||||
Reference in New Issue
Block a user