Improve cache not found error messages#55505
Conversation
| t, ok := s.cache.Get(index, key) | ||
| if !ok { | ||
| return t, trace.NotFound("no value for key %q in index %v", key, index) | ||
| return t, trace.NotFound("%v %q does not exist", reflect.TypeFor[T](), key) |
There was a problem hiding this comment.
Is this error user facing? Can we get to a resource kind string somehow?
There was a problem hiding this comment.
It could very well be returned to the user. I can likely restrict T to an interface that implements GetKind.
There was a problem hiding this comment.
That's going to be annoying for 153-style resources - is that better or worse than just requiring a user-friendly name for error messages in store?
...also, we're hitting this error message because failed to find the T, and almost all of our resources don't have a "static" GetKind method, they read the kind from the value. 😬
There was a problem hiding this comment.
It's probably less viable than adding a user friendly identifier, though, it will require more boilerplate to stuff in the appropriate string to each resource stores.
|
@rosstimothy See the table below for backport results.
|
Existing error message
New error message