-
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
ui: handle errors from unimplemented services #18020
Conversation
When a request is made to an RPC service that doesn't exist (for example, a cross-region request from a newer version of Nomad to an older version that doesn't implement the endpoint) the application should return an empty list as well.
Ember Test Audit comparison
|
const isNotImplemented = errorCodes.includes('501'); | ||
const isNotImplemented = | ||
errorCodes.includes('501') || | ||
error.message.includes("rpc: can't find service"); |
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.
Note for reviewers: this error comes from the stdlib: https://cs.opensource.google/go/go/+/refs/tags/go1.20.6:src/net/rpc/server.go;l=613
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.
There's a change a UI dev* might short-circuit this with an isNotImplemented handler in the future that just checks for 501
in a specific adapter layer. I don't think it's likely (we've always used super
so far to inherit from this one) but it would be safer if we eventually returned 501s for these. I don't know if changing the stdlib is at all a likelihood, though!
*it could be me! I forget stuff all the time!
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.
We would need to wrap the RPC error to change the status code. Not a big problem, but I suspect there may be lots of code to change 😅
I opened #18050 to track this.
When a request is made to an RPC service that doesn't exist (for example, a cross-region request from a newer version of Nomad to an older version that doesn't implement the endpoint) the application should return an empty list as well.
When a request is made to an RPC service that doesn't exist (for example, a cross-region request from a newer version of Nomad to an older version that doesn't implement the endpoint) the application should return an empty list as well.