Skip to content

Commit 87c7e36

Browse files
committed
Add dump-related errors
1 parent 9c80c45 commit 87c7e36

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/errors.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ pub enum ErrorCode {
117117
/// The payload content type is not supported by MeiliSearch. Currently,
118118
/// MeiliSearch only supports JSON payloads.
119119
UnsupportedMediaType,
120+
/// A dump creation is already in progress and a new one can't be triggered until the previous dump creation is not finished.
121+
DumpAlreadyInProgress,
122+
/// An error occured during dump creation process, task aborted.
123+
DumpProcessFailed,
120124

121125
/// That's unexpected. Please open a GitHub issue after ensuring you are
122126
/// using the supported version of the MeiliSearch server.
@@ -194,6 +198,9 @@ impl ErrorCode {
194198
ErrorCode::UnretrievableDocument => "unretrievable_document",
195199
ErrorCode::SearchError => "search_error",
196200
ErrorCode::UnsupportedMediaType => "unsupported_media_type",
201+
ErrorCode::DumpAlreadyInProgress => "dump_already_in_progress",
202+
ErrorCode::DumpProcessFailed => "dump_process_failed
203+
",
197204
// Other than this variant, all the other `&str`s are 'static
198205
ErrorCode::Unknown(inner) => &inner.0,
199206
}
@@ -227,6 +234,8 @@ impl ErrorCode {
227234
"unretrievable_document" => ErrorCode::UnretrievableDocument,
228235
"search_error" => ErrorCode::SearchError,
229236
"unsupported_media_type" => ErrorCode::UnsupportedMediaType,
237+
"dump_already_in_progress" => ErrorCode::DumpAlreadyInProgress,
238+
"dump_process_failed" => ErrorCode::DumpProcessFailed,
230239
inner => ErrorCode::Unknown(UnknownErrorCode(inner.to_string())),
231240
}
232241
}

0 commit comments

Comments
 (0)