mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-05-14 16:23:57 +02:00
Add new errors when there is a version mismatch between the bin and index or index-scheduler
This commit is contained in:
parent
b6a9d8d2ac
commit
ea9330e9c9
@ -155,6 +155,20 @@ pub enum Error {
|
|||||||
RollbackFailed { index: String, rollback_outcome: RollbackOutcome },
|
RollbackFailed { index: String, rollback_outcome: RollbackOutcome },
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
UnrecoverableError(Box<Self>),
|
UnrecoverableError(Box<Self>),
|
||||||
|
#[error("The index scheduler is in version v{}.{}.{}, but Meilisearch is in version v{}.{}.{}.\n - hint: start the correct version of Meilisearch, or consider updating your database. See also <https://www.meilisearch.com/docs/learn/update_and_migration/updating>",
|
||||||
|
index_scheduler_version.0, index_scheduler_version.1, index_scheduler_version.2,
|
||||||
|
package_version.0, package_version.1, package_version.2)]
|
||||||
|
IndexSchedulerVersionMismatch {
|
||||||
|
index_scheduler_version: (u32, u32, u32),
|
||||||
|
package_version: (u32, u32, u32),
|
||||||
|
},
|
||||||
|
#[error("Index `{index}` is in version v{}.{}.{}, but Meilisearch is in version v{}.{}.{}.\n - note: this is an internal error, please consider filing a bug report: <https://github.com/meilisearch/meilisearch/issues/new?template=bug_report.md>",
|
||||||
|
index_version.0, index_version.1, index_version.2, package_version.0, package_version.1, package_version.2)]
|
||||||
|
IndexVersionMismatch {
|
||||||
|
index: String,
|
||||||
|
index_version: (u32, u32, u32),
|
||||||
|
package_version: (u32, u32, u32),
|
||||||
|
},
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
HeedTransaction(heed::Error),
|
HeedTransaction(heed::Error),
|
||||||
|
|
||||||
@ -212,6 +226,8 @@ impl Error {
|
|||||||
| Error::CorruptedTaskQueue
|
| Error::CorruptedTaskQueue
|
||||||
| Error::DatabaseUpgrade(_)
|
| Error::DatabaseUpgrade(_)
|
||||||
| Error::UnrecoverableError(_)
|
| Error::UnrecoverableError(_)
|
||||||
|
| Error::IndexSchedulerVersionMismatch { .. }
|
||||||
|
| Error::IndexVersionMismatch { .. }
|
||||||
| Error::RollbackFailed { .. }
|
| Error::RollbackFailed { .. }
|
||||||
| Error::HeedTransaction(_) => false,
|
| Error::HeedTransaction(_) => false,
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
@ -280,6 +296,8 @@ impl ErrorCode for Error {
|
|||||||
Error::DatabaseUpgrade(_) => Code::Internal,
|
Error::DatabaseUpgrade(_) => Code::Internal,
|
||||||
Error::RollbackFailed { .. } => Code::Internal,
|
Error::RollbackFailed { .. } => Code::Internal,
|
||||||
Error::UnrecoverableError(_) => Code::Internal,
|
Error::UnrecoverableError(_) => Code::Internal,
|
||||||
|
Error::IndexSchedulerVersionMismatch { .. } => Code::Internal,
|
||||||
|
Error::IndexVersionMismatch { .. } => Code::Internal,
|
||||||
Error::CreateBatch(_) => Code::Internal,
|
Error::CreateBatch(_) => Code::Internal,
|
||||||
|
|
||||||
// This one should never be seen by the end user
|
// This one should never be seen by the end user
|
||||||
|
Loading…
x
Reference in New Issue
Block a user