mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-27 04:25:06 +08:00
Merge pull request #285 from bidoubiwa/remove_catching_same_index_creation
Change the error catching on the index creation route
This commit is contained in:
commit
0a8039d8d8
@ -66,9 +66,6 @@ pub async fn create_index(mut ctx: Context<Data>) -> SResult<Response> {
|
|||||||
|
|
||||||
let created_index = match db.create_index(&index_name) {
|
let created_index = match db.create_index(&index_name) {
|
||||||
Ok(index) => index,
|
Ok(index) => index,
|
||||||
Err(meilidb_core::Error::IndexAlreadyExists) => db.open_index(&index_name).ok_or(
|
|
||||||
ResponseError::internal("index not found but must have been found"),
|
|
||||||
)?,
|
|
||||||
Err(e) => return Err(ResponseError::create_index(e)),
|
Err(e) => return Err(ResponseError::create_index(e)),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user