-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change Error Messages In VTGate #7514
Change Error Messages In VTGate #7514
Conversation
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
cb512f5
to
e0e57dd
Compare
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
…o vterrors state Signed-off-by: Harshit Gangal <[email protected]>
…enerate vterrors errors that will be converted later to mysql errors Signed-off-by: Harshit Gangal <[email protected]>
fe89ca0
to
dfbf58d
Compare
Signed-off-by: Harshit Gangal <[email protected]>
…executor in vtgate Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
…rrors Signed-off-by: Harshit Gangal <[email protected]>
@@ -162,6 +149,56 @@ func NewSQLErrorFromError(err error) error { | |||
return serr | |||
} | |||
|
|||
var stateToMysqlCode = map[vterrors.State]struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -185,6 +188,24 @@ func Code(err error) vtrpcpb.Code { | |||
return vtrpcpb.Code_UNKNOWN | |||
} | |||
|
|||
// ErrState returns the error state if it's a vtError. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
} | ||
for i, field2 := range fields2 { | ||
field1 := fields1[i] | ||
if field1.Type != field2.Type { | ||
return vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "column field type does not match for name: (%v, %v) types: (%v, %v)", field1.Name, field2.Name, field1.Type, field2.Type) | ||
return vterrors.Errorf(vtrpcpb.Code_UNIMPLEMENTED, "merging field of different types is not supported, name: (%v, %v) types: (%v, %v)", field1.Name, field2.Name, field1.Type, field2.Type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Signed-off-by: Harshit Gangal <[email protected]>
go/vt/vtgate/vcursor_impl.go
Outdated
if !allowed { | ||
return vterrors.Errorf(vtrpcpb.Code_PERMISSION_DENIED, "not authorized to perform vschema operations") | ||
|
||
return vterrors.NewErrorf(vtrpcpb.Code_PERMISSION_DENIED, vterrors.AccessDeniedError, "User '%s' to perform vschema operations", user.GetUsername()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this message looks a bit weird to me.
shouldn't it say: User '%s' is not authorized to perform vschema operations
Signed-off-by: Andres Taylor <[email protected]>
dd7e031
to
08765a7
Compare
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
619cb1d
to
2ab202b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error is always send back to client. If the target is not nil then it is added to the error message. I will go ahead and merge the PR. If there is any concern we can fix forward. |
Signed-off-by: Harshit Gangal [email protected]
Description
Related Issue(s)
#7533
Checklist
Deployment Notes
Impacted Areas in Vitess
Components that this PR will affect: