Conversation
app/cli/main.go
Outdated
| func isWrappedErr(grpcStatus *status.Status, err *errors.Error) bool { | ||
| target := errors.FromError(grpcStatus.Err()) | ||
| return target.Code == err.Code && err.Message == target.Message | ||
| return target.Code == err.Code && strings.Contains(target.Message, err.Message) |
There was a problem hiding this comment.
mm, this looks like a little bit of a hack that could cause false positives. Do you know when and why this started failing? Was it because we are now wrapping when we should not?
There was a problem hiding this comment.
The error in backend might have changed. It was a hack already anyways, since it was comparing error strings in client side, instead of just the error code or a typed error object.
So what's now? Will be be reverted to what originally was which was handled locally as I mentioned in the issue? |
|
I'll work as it did before, seems like part of the output was missing in the description and I didn't notice. In general the problem is that grpc status returns message that looks like full error instead of only returning the message part: Which then before was matched against |
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
0a28c60 to
02ea58c
Compare
|
This is the actual fix #2450 so I'd suggest closing this one. |
This PR grcp errors not being properly caught and replaced with more user friendly error in CLI.
Closes #2434