-
Notifications
You must be signed in to change notification settings - Fork 2k
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 <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
cb512f5
to
e0e57dd
Compare
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
…o vterrors state Signed-off-by: Harshit Gangal <harshit@planetscale.com>
…enerate vterrors errors that will be converted later to mysql errors Signed-off-by: Harshit Gangal <harshit@planetscale.com>
fe89ca0
to
dfbf58d
Compare
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
…executor in vtgate Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
…rrors Signed-off-by: Harshit Gangal <harshit@planetscale.com>
@@ -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 <harshit@planetscale.com>
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 <andres@planetscale.com>
dd7e031
to
08765a7
Compare
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
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 harshit@planetscale.com
Description
Related Issue(s)
#7533
Checklist
Deployment Notes
Impacted Areas in Vitess
Components that this PR will affect: