mirror of
https://github.com/ankitects/anki.git
synced 2025-12-10 21:36:55 -05:00
info is superfluous
This commit is contained in:
parent
644670d0d6
commit
b610ff781f
2 changed files with 14 additions and 24 deletions
|
|
@ -77,10 +77,10 @@ message BackendError {
|
||||||
string localized = 1;
|
string localized = 1;
|
||||||
// error specifics
|
// error specifics
|
||||||
oneof value {
|
oneof value {
|
||||||
StringError invalid_input = 2;
|
Empty invalid_input = 2;
|
||||||
StringError template_parse = 3;
|
Empty template_parse = 3;
|
||||||
StringError io_error = 4;
|
Empty io_error = 4;
|
||||||
StringError db_error = 5;
|
Empty db_error = 5;
|
||||||
NetworkError network_error = 6;
|
NetworkError network_error = 6;
|
||||||
SyncError sync_error = 7;
|
SyncError sync_error = 7;
|
||||||
// user interrupted operation
|
// user interrupted operation
|
||||||
|
|
@ -95,23 +95,17 @@ message Progress {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
message StringError {
|
|
||||||
string info = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message NetworkError {
|
message NetworkError {
|
||||||
string info = 1;
|
|
||||||
enum NetworkErrorKind {
|
enum NetworkErrorKind {
|
||||||
OTHER = 0;
|
OTHER = 0;
|
||||||
OFFLINE = 1;
|
OFFLINE = 1;
|
||||||
TIMEOUT = 2;
|
TIMEOUT = 2;
|
||||||
PROXY_AUTH = 3;
|
PROXY_AUTH = 3;
|
||||||
}
|
}
|
||||||
NetworkErrorKind kind = 2;
|
NetworkErrorKind kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SyncError {
|
message SyncError {
|
||||||
string info = 1;
|
|
||||||
enum SyncErrorKind {
|
enum SyncErrorKind {
|
||||||
OTHER = 0;
|
OTHER = 0;
|
||||||
CONFLICT = 1;
|
CONFLICT = 1;
|
||||||
|
|
@ -122,7 +116,7 @@ message SyncError {
|
||||||
MEDIA_CHECK_REQUIRED = 6;
|
MEDIA_CHECK_REQUIRED = 6;
|
||||||
RESYNC_REQUIRED = 7;
|
RESYNC_REQUIRED = 7;
|
||||||
}
|
}
|
||||||
SyncErrorKind kind = 2;
|
SyncErrorKind kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message MediaSyncProgress {
|
message MediaSyncProgress {
|
||||||
|
|
|
||||||
|
|
@ -44,18 +44,14 @@ fn anki_error_to_proto_error(err: AnkiError, i18n: &I18n) -> pb::BackendError {
|
||||||
use pb::backend_error::Value as V;
|
use pb::backend_error::Value as V;
|
||||||
let localized = err.localized_description(i18n);
|
let localized = err.localized_description(i18n);
|
||||||
let value = match err {
|
let value = match err {
|
||||||
AnkiError::InvalidInput { info } => V::InvalidInput(pb::StringError { info }),
|
AnkiError::InvalidInput { .. } => V::InvalidInput(pb::Empty {}),
|
||||||
AnkiError::TemplateError { info } => V::TemplateParse(pb::StringError { info }),
|
AnkiError::TemplateError { .. } => V::TemplateParse(pb::Empty {}),
|
||||||
AnkiError::IOError { info } => V::IoError(pb::StringError { info }),
|
AnkiError::IOError { .. } => V::IoError(pb::Empty {}),
|
||||||
AnkiError::DBError { info } => V::DbError(pb::StringError { info }),
|
AnkiError::DBError { .. } => V::DbError(pb::Empty {}),
|
||||||
AnkiError::NetworkError { info, kind } => V::NetworkError(pb::NetworkError {
|
AnkiError::NetworkError { kind, .. } => {
|
||||||
info,
|
V::NetworkError(pb::NetworkError { kind: kind.into() })
|
||||||
kind: kind.into(),
|
}
|
||||||
}),
|
AnkiError::SyncError { kind, .. } => V::SyncError(pb::SyncError { kind: kind.into() }),
|
||||||
AnkiError::SyncError { info, kind } => V::SyncError(pb::SyncError {
|
|
||||||
info,
|
|
||||||
kind: kind.into(),
|
|
||||||
}),
|
|
||||||
AnkiError::Interrupted => V::Interrupted(Empty {}),
|
AnkiError::Interrupted => V::Interrupted(Empty {}),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue