1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
45use interrupt_support::Interrupted;
67#[derive(Debug, thiserror::Error)]
8pub enum SyncManagerError {
9#[error("Unknown engine: {0}")]
10UnknownEngine(String),
11#[error("Manager was compiled without support for {0:?}")]
12UnsupportedFeature(String),
13// Used for things like 'failed to decode the provided sync key because it's
14 // completely the wrong format', etc.
15#[error("Sync error: {0}")]
16Sync15Error(#[from] sync15::Error),
17#[error("URL parse error: {0}")]
18UrlParseError(#[from] url::ParseError),
19#[error("Operation interrupted")]
20InterruptedError(#[from] Interrupted),
21#[error("Error parsing JSON data: {0}")]
22JsonError(#[from] serde_json::Error),
23#[error("Logins error: {0}")]
24LoginsError(#[from] logins::Error),
25#[error("Places error: {0}")]
26PlacesError(#[from] places::Error),
27// We should probably upgrade this crate to anyhow, which would mean this
28 // gets replaced with AutofillError or similar.
29#[error("External error: {0}")]
30AnyhowError(#[from] anyhow::Error),
31}
3233pub type Result<T> = std::result::Result<T, SyncManagerError>;