-
Notifications
You must be signed in to change notification settings - Fork 221
/
error.rs
33 lines (31 loc) · 1.3 KB
/
error.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use failure::Fail;
#[derive(Debug, Fail)]
pub enum ErrorKind {
#[fail(display = "Unknown engine: {}", _0)]
UnknownEngine(String),
#[fail(display = "Manager was compiled without support for {:?}", _0)]
UnsupportedFeature(String),
#[fail(display = "Database connection for '{}' is not open", _0)]
ConnectionClosed(String),
#[fail(display = "Handle is invalid: {}", _0)]
InvalidHandle(#[fail(cause)] ffi_support::HandleError),
#[fail(display = "Protobuf decode error: {}", _0)]
ProtobufDecodeError(#[fail(cause)] prost::DecodeError),
// Used for things like 'failed to decode the provided sync key because it's
// completely the wrong format', etc.
#[fail(display = "Sync error: {}", _0)]
Sync15Error(#[fail(cause)] sync15::Error),
#[fail(display = "URL parse error: {}", _0)]
UrlParseError(#[fail(cause)] url::ParseError),
}
error_support::define_error! {
ErrorKind {
(InvalidHandle, ffi_support::HandleError),
(ProtobufDecodeError, prost::DecodeError),
(Sync15Error, sync15::Error),
(UrlParseError, url::ParseError),
}
}