Skip to content

Commit 67f2ae4

Browse files
committed
feat(api/middleware): Enhance keyspace not exist error with request URI
- Improve error message clarity by including the request URI when a keyspace does not exist. - This provides more context for debugging `KeyspaceNotExistError` cases. Signed-off-by: tenfyzhong <[email protected]>
1 parent c52ee84 commit 67f2ae4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

api/middleware/middleware.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ func KeyspaceCheckerMiddleware() gin.HandlerFunc {
229229

230230
meta, err := pdAPIClient.LoadKeyspace(c.Request.Context(), keyspace)
231231
if errors.IsKeyspaceNotExistError(err) {
232-
c.IndentedJSON(http.StatusBadRequest, errors.ErrAPIInvalidParam)
232+
c.IndentedJSON(http.StatusBadRequest, errors.ErrAPIInvalidParam.FastGen("URI:%s", c.Request.URL))
233233
c.Abort()
234234
return
235235
} else if err != nil {

0 commit comments

Comments
 (0)