Skip to content

fix: search_extension should not panic when ext is not found#983

Merged
ayangweb merged 1 commit intomainfrom
steve/fix/extension_store_not_found
Nov 19, 2025
Merged

fix: search_extension should not panic when ext is not found#983
ayangweb merged 1 commit intomainfrom
steve/fix/extension_store_not_found

Conversation

@SteveLauC
Copy link
Copy Markdown
Member

@SteveLauC SteveLauC commented Nov 19, 2025

This commit fixes a bug that the search_extension() function panics
when the "GET /store/_search" interface returns a 404 response.

GET /store/_search?query=<query string>
{"_id":"_search","result":"not_found"}

It also improves the panic message by including varaible "response" in it,
so that we can inspect the actual response.

let hits_json = response.remove("hits").unwrap_or_else(|| {
    panic!(
        "the JSON response should contain field [hits], response [{:?}]",
        response
    )
});

Standards checklist

  • The PR title is descriptive
  • The commit messages are semantic
  • Necessary tests are added
  • Updated the release notes
  • Necessary documents have been added if this is a new feature
  • Performance tests checked, no obvious performance degradation

@SteveLauC SteveLauC force-pushed the steve/fix/extension_store_not_found branch from 659489f to b2cf1fe Compare November 19, 2025 01:41
@SteveLauC SteveLauC marked this pull request as ready for review November 19, 2025 01:41
This commit fixes a bug that the search_extension() function panics
when the "GET /store/_search" interface returns a 404 response.

```
GET /store/_search?query=<query string>
{"_id":"_search","result":"not_found"}
```

It also improves the panic message by including varaible "response" in it,
so that we can inspect the actual response.

```
let hits_json = response.remove("hits").unwrap_or_else(|| {
    panic!(
        "the JSON response should contain field [hits], response [{:?}]",
        response
    )
});
```
@SteveLauC SteveLauC force-pushed the steve/fix/extension_store_not_found branch from b2cf1fe to 7ed62ea Compare November 19, 2025 01:51
@ayangweb ayangweb merged commit 533bfaf into main Nov 19, 2025
4 checks passed
@ayangweb ayangweb deleted the steve/fix/extension_store_not_found branch November 19, 2025 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants