mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 06:44:27 +01:00
fix all the error codes
This commit is contained in:
parent
ba150f2127
commit
3872a1b8d1
@ -294,41 +294,41 @@ impl From<v2::updates::UpdateResult> for v3::updates::UpdateResult {
|
|||||||
impl From<String> for v3::Code {
|
impl From<String> for v3::Code {
|
||||||
fn from(code: String) -> Self {
|
fn from(code: String) -> Self {
|
||||||
match code.as_ref() {
|
match code.as_ref() {
|
||||||
"CreateIndex" => v3::Code::CreateIndex,
|
"create_index" => v3::Code::CreateIndex,
|
||||||
"IndexAlreadyExists" => v3::Code::IndexAlreadyExists,
|
"index_already_exists" => v3::Code::IndexAlreadyExists,
|
||||||
"IndexNotFound" => v3::Code::IndexNotFound,
|
"index_not_found" => v3::Code::IndexNotFound,
|
||||||
"InvalidIndexUid" => v3::Code::InvalidIndexUid,
|
"invalid_index_uid" => v3::Code::InvalidIndexUid,
|
||||||
"InvalidState" => v3::Code::InvalidState,
|
"invalid_state" => v3::Code::InvalidState,
|
||||||
"MissingPrimaryKey" => v3::Code::MissingPrimaryKey,
|
"missing_primary_key" => v3::Code::MissingPrimaryKey,
|
||||||
"PrimaryKeyAlreadyPresent" => v3::Code::PrimaryKeyAlreadyPresent,
|
"primary_key_already_present" => v3::Code::PrimaryKeyAlreadyPresent,
|
||||||
"MaxFieldsLimitExceeded" => v3::Code::MaxFieldsLimitExceeded,
|
"max_fields_limit_exceeded" => v3::Code::MaxFieldsLimitExceeded,
|
||||||
"MissingDocumentId" => v3::Code::MissingDocumentId,
|
"missing_document_id" => v3::Code::MissingDocumentId,
|
||||||
"InvalidDocumentId" => v3::Code::InvalidDocumentId,
|
"invalid_document_id" => v3::Code::InvalidDocumentId,
|
||||||
"Filter" => v3::Code::Filter,
|
"filter" => v3::Code::Filter,
|
||||||
"Sort" => v3::Code::Sort,
|
"sort" => v3::Code::Sort,
|
||||||
"BadParameter" => v3::Code::BadParameter,
|
"bad_parameter" => v3::Code::BadParameter,
|
||||||
"BadRequest" => v3::Code::BadRequest,
|
"bad_request" => v3::Code::BadRequest,
|
||||||
"DatabaseSizeLimitReached" => v3::Code::DatabaseSizeLimitReached,
|
"database_size_limit_reached" => v3::Code::DatabaseSizeLimitReached,
|
||||||
"DocumentNotFound" => v3::Code::DocumentNotFound,
|
"document_not_found" => v3::Code::DocumentNotFound,
|
||||||
"Internal" => v3::Code::Internal,
|
"internal" => v3::Code::Internal,
|
||||||
"InvalidGeoField" => v3::Code::InvalidGeoField,
|
"invalid_geo_field" => v3::Code::InvalidGeoField,
|
||||||
"InvalidRankingRule" => v3::Code::InvalidRankingRule,
|
"invalid_ranking_rule" => v3::Code::InvalidRankingRule,
|
||||||
"InvalidStore" => v3::Code::InvalidStore,
|
"invalid_store" => v3::Code::InvalidStore,
|
||||||
"InvalidToken" => v3::Code::InvalidToken,
|
"invalid_token" => v3::Code::InvalidToken,
|
||||||
"MissingAuthorizationHeader" => v3::Code::MissingAuthorizationHeader,
|
"missing_authorization_header" => v3::Code::MissingAuthorizationHeader,
|
||||||
"NoSpaceLeftOnDevice" => v3::Code::NoSpaceLeftOnDevice,
|
"no_space_left_on_device" => v3::Code::NoSpaceLeftOnDevice,
|
||||||
"DumpNotFound" => v3::Code::DumpNotFound,
|
"dump_not_found" => v3::Code::DumpNotFound,
|
||||||
"TaskNotFound" => v3::Code::TaskNotFound,
|
"task_not_found" => v3::Code::TaskNotFound,
|
||||||
"PayloadTooLarge" => v3::Code::PayloadTooLarge,
|
"payload_too_large" => v3::Code::PayloadTooLarge,
|
||||||
"RetrieveDocument" => v3::Code::RetrieveDocument,
|
"retrieve_document" => v3::Code::RetrieveDocument,
|
||||||
"SearchDocuments" => v3::Code::SearchDocuments,
|
"search_documents" => v3::Code::SearchDocuments,
|
||||||
"UnsupportedMediaType" => v3::Code::UnsupportedMediaType,
|
"unsupported_media_type" => v3::Code::UnsupportedMediaType,
|
||||||
"DumpAlreadyInProgress" => v3::Code::DumpAlreadyInProgress,
|
"dump_already_in_progress" => v3::Code::DumpAlreadyInProgress,
|
||||||
"DumpProcessFailed" => v3::Code::DumpProcessFailed,
|
"dump_process_failed" => v3::Code::DumpProcessFailed,
|
||||||
"InvalidContentType" => v3::Code::InvalidContentType,
|
"invalid_content_type" => v3::Code::InvalidContentType,
|
||||||
"MissingContentType" => v3::Code::MissingContentType,
|
"missing_content_type" => v3::Code::MissingContentType,
|
||||||
"MalformedPayload" => v3::Code::MalformedPayload,
|
"malformed_payload" => v3::Code::MalformedPayload,
|
||||||
"MissingPayload" => v3::Code::MissingPayload,
|
"missing_payload" => v3::Code::MissingPayload,
|
||||||
other => {
|
other => {
|
||||||
log::warn!("Unknown error code {}", other);
|
log::warn!("Unknown error code {}", other);
|
||||||
v3::Code::UnretrievableErrorCode
|
v3::Code::UnretrievableErrorCode
|
||||||
|
@ -274,48 +274,48 @@ impl<T> From<v4::Setting<T>> for v5::Setting<T> {
|
|||||||
impl From<v4::ResponseError> for v5::ResponseError {
|
impl From<v4::ResponseError> for v5::ResponseError {
|
||||||
fn from(error: v4::ResponseError) -> Self {
|
fn from(error: v4::ResponseError) -> Self {
|
||||||
let code = match error.error_code.as_ref() {
|
let code = match error.error_code.as_ref() {
|
||||||
"CreateIndex" => v5::Code::CreateIndex,
|
"index_creation_failed" => v5::Code::CreateIndex,
|
||||||
"IndexAlreadyExists" => v5::Code::IndexAlreadyExists,
|
"index_already_exists" => v5::Code::IndexAlreadyExists,
|
||||||
"IndexNotFound" => v5::Code::IndexNotFound,
|
"index_not_found" => v5::Code::IndexNotFound,
|
||||||
"InvalidIndexUid" => v5::Code::InvalidIndexUid,
|
"invalid_index_uid" => v5::Code::InvalidIndexUid,
|
||||||
"InvalidMinWordLengthForTypo" => v5::Code::InvalidMinWordLengthForTypo,
|
"invalid_min_word_length_for_typo" => v5::Code::InvalidMinWordLengthForTypo,
|
||||||
"InvalidState" => v5::Code::InvalidState,
|
"invalid_state" => v5::Code::InvalidState,
|
||||||
"MissingPrimaryKey" => v5::Code::MissingPrimaryKey,
|
"primary_key_inference_failed" => v5::Code::MissingPrimaryKey,
|
||||||
"PrimaryKeyAlreadyPresent" => v5::Code::PrimaryKeyAlreadyPresent,
|
"index_primary_key_already_exists" => v5::Code::PrimaryKeyAlreadyPresent,
|
||||||
"MaxFieldsLimitExceeded" => v5::Code::MaxFieldsLimitExceeded,
|
"max_fields_limit_exceeded" => v5::Code::MaxFieldsLimitExceeded,
|
||||||
"MissingDocumentId" => v5::Code::MissingDocumentId,
|
"missing_document_id" => v5::Code::MissingDocumentId,
|
||||||
"InvalidDocumentId" => v5::Code::InvalidDocumentId,
|
"invalid_document_id" => v5::Code::InvalidDocumentId,
|
||||||
"Filter" => v5::Code::Filter,
|
"invalid_filter" => v5::Code::Filter,
|
||||||
"Sort" => v5::Code::Sort,
|
"invalid_sort" => v5::Code::Sort,
|
||||||
"BadParameter" => v5::Code::BadParameter,
|
"bad_parameter" => v5::Code::BadParameter,
|
||||||
"BadRequest" => v5::Code::BadRequest,
|
"bad_request" => v5::Code::BadRequest,
|
||||||
"DatabaseSizeLimitReached" => v5::Code::DatabaseSizeLimitReached,
|
"database_size_limit_reached" => v5::Code::DatabaseSizeLimitReached,
|
||||||
"DocumentNotFound" => v5::Code::DocumentNotFound,
|
"document_not_found" => v5::Code::DocumentNotFound,
|
||||||
"Internal" => v5::Code::Internal,
|
"internal" => v5::Code::Internal,
|
||||||
"InvalidGeoField" => v5::Code::InvalidGeoField,
|
"invalid_geo_field" => v5::Code::InvalidGeoField,
|
||||||
"InvalidRankingRule" => v5::Code::InvalidRankingRule,
|
"invalid_ranking_rule" => v5::Code::InvalidRankingRule,
|
||||||
"InvalidStore" => v5::Code::InvalidStore,
|
"invalid_store_file" => v5::Code::InvalidStore,
|
||||||
"InvalidToken" => v5::Code::InvalidToken,
|
"invalid_api_key" => v5::Code::InvalidToken,
|
||||||
"MissingAuthorizationHeader" => v5::Code::MissingAuthorizationHeader,
|
"missing_authorization_header" => v5::Code::MissingAuthorizationHeader,
|
||||||
"NoSpaceLeftOnDevice" => v5::Code::NoSpaceLeftOnDevice,
|
"no_space_left_on_device" => v5::Code::NoSpaceLeftOnDevice,
|
||||||
"DumpNotFound" => v5::Code::DumpNotFound,
|
"dump_not_found" => v5::Code::DumpNotFound,
|
||||||
"TaskNotFound" => v5::Code::TaskNotFound,
|
"task_not_found" => v5::Code::TaskNotFound,
|
||||||
"PayloadTooLarge" => v5::Code::PayloadTooLarge,
|
"payload_too_large" => v5::Code::PayloadTooLarge,
|
||||||
"RetrieveDocument" => v5::Code::RetrieveDocument,
|
"unretrievable_document" => v5::Code::RetrieveDocument,
|
||||||
"SearchDocuments" => v5::Code::SearchDocuments,
|
"search_error" => v5::Code::SearchDocuments,
|
||||||
"UnsupportedMediaType" => v5::Code::UnsupportedMediaType,
|
"unsupported_media_type" => v5::Code::UnsupportedMediaType,
|
||||||
"DumpAlreadyInProgress" => v5::Code::DumpAlreadyInProgress,
|
"dump_already_processing" => v5::Code::DumpAlreadyInProgress,
|
||||||
"DumpProcessFailed" => v5::Code::DumpProcessFailed,
|
"dump_process_failed" => v5::Code::DumpProcessFailed,
|
||||||
"InvalidContentType" => v5::Code::InvalidContentType,
|
"invalid_content_type" => v5::Code::InvalidContentType,
|
||||||
"MissingContentType" => v5::Code::MissingContentType,
|
"missing_content_type" => v5::Code::MissingContentType,
|
||||||
"MalformedPayload" => v5::Code::MalformedPayload,
|
"malformed_payload" => v5::Code::MalformedPayload,
|
||||||
"MissingPayload" => v5::Code::MissingPayload,
|
"missing_payload" => v5::Code::MissingPayload,
|
||||||
"ApiKeyNotFound" => v5::Code::ApiKeyNotFound,
|
"api_key_not_found" => v5::Code::ApiKeyNotFound,
|
||||||
"MissingParameter" => v5::Code::MissingParameter,
|
"missing_parameter" => v5::Code::MissingParameter,
|
||||||
"InvalidApiKeyActions" => v5::Code::InvalidApiKeyActions,
|
"invalid_api_key_actions" => v5::Code::InvalidApiKeyActions,
|
||||||
"InvalidApiKeyIndexes" => v5::Code::InvalidApiKeyIndexes,
|
"invalid_api_key_indexes" => v5::Code::InvalidApiKeyIndexes,
|
||||||
"InvalidApiKeyExpiresAt" => v5::Code::InvalidApiKeyExpiresAt,
|
"invalid_api_key_expires_at" => v5::Code::InvalidApiKeyExpiresAt,
|
||||||
"InvalidApiKeyDescription" => v5::Code::InvalidApiKeyDescription,
|
"invalid_api_key_description" => v5::Code::InvalidApiKeyDescription,
|
||||||
other => {
|
other => {
|
||||||
log::warn!("Unknown error code {}", other);
|
log::warn!("Unknown error code {}", other);
|
||||||
v5::Code::UnretrievableErrorCode
|
v5::Code::UnretrievableErrorCode
|
||||||
|
@ -251,52 +251,52 @@ impl<T> From<v5::Setting<T>> for v6::Setting<T> {
|
|||||||
impl From<v5::ResponseError> for v6::ResponseError {
|
impl From<v5::ResponseError> for v6::ResponseError {
|
||||||
fn from(error: v5::ResponseError) -> Self {
|
fn from(error: v5::ResponseError) -> Self {
|
||||||
let code = match error.error_code.as_ref() {
|
let code = match error.error_code.as_ref() {
|
||||||
"CreateIndex" => v6::Code::CreateIndex,
|
"index_creation_failed" => v6::Code::CreateIndex,
|
||||||
"IndexAlreadyExists" => v6::Code::IndexAlreadyExists,
|
"index_already_exists" => v6::Code::IndexAlreadyExists,
|
||||||
"IndexNotFound" => v6::Code::IndexNotFound,
|
"index_not_found" => v6::Code::IndexNotFound,
|
||||||
"InvalidIndexUid" => v6::Code::InvalidIndexUid,
|
"invalid_index_uid" => v6::Code::InvalidIndexUid,
|
||||||
"InvalidMinWordLengthForTypo" => v6::Code::InvalidMinWordLengthForTypo,
|
"invalid_min_word_length_for_typo" => v6::Code::InvalidMinWordLengthForTypo,
|
||||||
"InvalidState" => v6::Code::InvalidState,
|
"invalid_state" => v6::Code::InvalidState,
|
||||||
"MissingPrimaryKey" => v6::Code::MissingPrimaryKey,
|
"primary_key_inference_failed" => v6::Code::MissingPrimaryKey,
|
||||||
"PrimaryKeyAlreadyPresent" => v6::Code::PrimaryKeyAlreadyPresent,
|
"index_primary_key_already_exists" => v6::Code::PrimaryKeyAlreadyPresent,
|
||||||
"MaxFieldsLimitExceeded" => v6::Code::MaxFieldsLimitExceeded,
|
"max_fields_limit_exceeded" => v6::Code::MaxFieldsLimitExceeded,
|
||||||
"MissingDocumentId" => v6::Code::MissingDocumentId,
|
"missing_document_id" => v6::Code::MissingDocumentId,
|
||||||
"InvalidDocumentId" => v6::Code::InvalidDocumentId,
|
"invalid_document_id" => v6::Code::InvalidDocumentId,
|
||||||
"Filter" => v6::Code::Filter,
|
"invalid_filter" => v6::Code::Filter,
|
||||||
"Sort" => v6::Code::Sort,
|
"invalid_sort" => v6::Code::Sort,
|
||||||
"BadParameter" => v6::Code::BadParameter,
|
"bad_parameter" => v6::Code::BadParameter,
|
||||||
"BadRequest" => v6::Code::BadRequest,
|
"bad_request" => v6::Code::BadRequest,
|
||||||
"DatabaseSizeLimitReached" => v6::Code::DatabaseSizeLimitReached,
|
"database_size_limit_reached" => v6::Code::DatabaseSizeLimitReached,
|
||||||
"DocumentNotFound" => v6::Code::DocumentNotFound,
|
"document_not_found" => v6::Code::DocumentNotFound,
|
||||||
"Internal" => v6::Code::Internal,
|
"internal" => v6::Code::Internal,
|
||||||
"InvalidGeoField" => v6::Code::InvalidGeoField,
|
"invalid_geo_field" => v6::Code::InvalidGeoField,
|
||||||
"InvalidRankingRule" => v6::Code::InvalidRankingRule,
|
"invalid_ranking_rule" => v6::Code::InvalidRankingRule,
|
||||||
"InvalidStore" => v6::Code::InvalidStore,
|
"invalid_store_file" => v6::Code::InvalidStore,
|
||||||
"InvalidToken" => v6::Code::InvalidToken,
|
"invalid_api_key" => v6::Code::InvalidToken,
|
||||||
"MissingAuthorizationHeader" => v6::Code::MissingAuthorizationHeader,
|
"missing_authorization_header" => v6::Code::MissingAuthorizationHeader,
|
||||||
"NoSpaceLeftOnDevice" => v6::Code::NoSpaceLeftOnDevice,
|
"no_space_left_on_device" => v6::Code::NoSpaceLeftOnDevice,
|
||||||
"DumpNotFound" => v6::Code::DumpNotFound,
|
"dump_not_found" => v6::Code::DumpNotFound,
|
||||||
"TaskNotFound" => v6::Code::TaskNotFound,
|
"task_not_found" => v6::Code::TaskNotFound,
|
||||||
"PayloadTooLarge" => v6::Code::PayloadTooLarge,
|
"payload_too_large" => v6::Code::PayloadTooLarge,
|
||||||
"RetrieveDocument" => v6::Code::RetrieveDocument,
|
"unretrievable_document" => v6::Code::RetrieveDocument,
|
||||||
"SearchDocuments" => v6::Code::SearchDocuments,
|
"search_error" => v6::Code::SearchDocuments,
|
||||||
"UnsupportedMediaType" => v6::Code::UnsupportedMediaType,
|
"unsupported_media_type" => v6::Code::UnsupportedMediaType,
|
||||||
"DumpAlreadyInProgress" => v6::Code::DumpAlreadyInProgress,
|
"dump_already_processing" => v6::Code::DumpAlreadyInProgress,
|
||||||
"DumpProcessFailed" => v6::Code::DumpProcessFailed,
|
"dump_process_failed" => v6::Code::DumpProcessFailed,
|
||||||
"InvalidContentType" => v6::Code::InvalidContentType,
|
"invalid_content_type" => v6::Code::InvalidContentType,
|
||||||
"MissingContentType" => v6::Code::MissingContentType,
|
"missing_content_type" => v6::Code::MissingContentType,
|
||||||
"MalformedPayload" => v6::Code::MalformedPayload,
|
"malformed_payload" => v6::Code::MalformedPayload,
|
||||||
"MissingPayload" => v6::Code::MissingPayload,
|
"missing_payload" => v6::Code::MissingPayload,
|
||||||
"ApiKeyNotFound" => v6::Code::ApiKeyNotFound,
|
"api_key_not_found" => v6::Code::ApiKeyNotFound,
|
||||||
"MissingParameter" => v6::Code::MissingParameter,
|
"missing_parameter" => v6::Code::MissingParameter,
|
||||||
"InvalidApiKeyActions" => v6::Code::InvalidApiKeyActions,
|
"invalid_api_key_actions" => v6::Code::InvalidApiKeyActions,
|
||||||
"InvalidApiKeyIndexes" => v6::Code::InvalidApiKeyIndexes,
|
"invalid_api_key_indexes" => v6::Code::InvalidApiKeyIndexes,
|
||||||
"InvalidApiKeyExpiresAt" => v6::Code::InvalidApiKeyExpiresAt,
|
"invalid_api_key_expires_at" => v6::Code::InvalidApiKeyExpiresAt,
|
||||||
"InvalidApiKeyDescription" => v6::Code::InvalidApiKeyDescription,
|
"invalid_api_key_description" => v6::Code::InvalidApiKeyDescription,
|
||||||
"InvalidApiKeyName" => v6::Code::InvalidApiKeyName,
|
"invalid_api_key_name" => v6::Code::InvalidApiKeyName,
|
||||||
"InvalidApiKeyUid" => v6::Code::InvalidApiKeyUid,
|
"invalid_api_key_uid" => v6::Code::InvalidApiKeyUid,
|
||||||
"ImmutableField" => v6::Code::ImmutableField,
|
"immutable_field" => v6::Code::ImmutableField,
|
||||||
"ApiKeyAlreadyExists" => v6::Code::ApiKeyAlreadyExists,
|
"api_key_already_exists" => v6::Code::ApiKeyAlreadyExists,
|
||||||
other => {
|
other => {
|
||||||
log::warn!("Unknown error code {}", other);
|
log::warn!("Unknown error code {}", other);
|
||||||
v6::Code::UnretrievableErrorCode
|
v6::Code::UnretrievableErrorCode
|
||||||
|
Loading…
Reference in New Issue
Block a user