-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.rs
More file actions
125 lines (89 loc) · 3.02 KB
/
Copy patherror.rs
File metadata and controls
125 lines (89 loc) · 3.02 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
use thiserror::Error;
use std::sync::mpsc::{RecvError, SendError};
use verdict::{ParseError, ValidationError};
#[derive(Error, Debug)]
pub enum Error {
#[error("IO error: {0}")]
IOError(#[from] std::io::Error),
#[error("csv error: {0}")]
CSVError(#[from] csv::Error),
#[error("found BEGIN CERTIFICATE without matching END CERTIFICATE")]
NoMatchingEndCertificate,
#[error("found END CERTIFICATE without matching BEGIN CERTIFICATE")]
NoMatchingBeginCertificate,
#[error("validation error: {0:?}")]
ChainValidationError(#[from] ValidationError),
#[error("regex error: {0}")]
RegexError(#[from] regex::Error),
#[error("channel send error: {0}")]
SendError(String),
#[error("channel receive error: {0}")]
RecvError(String),
#[error("repeat number must be positive")]
ZeroRepeat,
#[error("different validation time given at spawn and in task")]
Inconsistentimestamps,
#[error("libfaketime.so not found at {0}")]
LibFakeTimeNotFound(String),
#[error("chrome not found at {0}")]
ChromeRepoNotFound(String),
#[error("firefox not found at {0}")]
FirefoxRepoNotFound(String),
#[error("openssl cert bench not found at {0}")]
OpenSSLRepoNotFound(String),
#[error("armor driver not found at {0}")]
ArmorRepoNotFound(String),
#[error("hammurabi bench program not found at {0}")]
HammurabiRepoNotFound(String),
#[error("ceres driver not found at {0}")]
CeresRepoNotFound(String),
#[error("failed to get child process stdin")]
ChildStdin,
#[error("failed to get child process stdout")]
ChildStdout,
#[error("empty certificate bundle")]
EmptyBundle,
#[error("cert bench error: {0}")]
CommonBenchError(String),
#[error("duration overflow")]
DurationOverflow,
#[error("verdict bench error: {0}")]
VerdictBenchError(String),
#[error("failed to decode UTF-8: {0}")]
UTF8Error(#[from] std::str::Utf8Error),
#[error("failed to decode UTF-8: {0}")]
StringUTF8Error(#[from] std::string::FromUtf8Error),
#[error("JSON parsing error: {0}")]
JSONError(#[from] serde_json::Error),
#[error("Limbo test error: {0}")]
LimboError(String),
#[error("root certificates not found at {0}")]
RootsNotFound(String),
#[error("parse error: {0:?}")]
ParseError(ParseError),
}
impl From<ParseError> for Error {
fn from(err: ParseError) -> Self {
Error::ParseError(err)
}
}
impl<T> From<SendError<T>> for Error {
fn from(err: SendError<T>) -> Self {
Error::SendError(err.to_string())
}
}
impl<T> From<crossbeam::channel::SendError<T>> for Error {
fn from(err: crossbeam::channel::SendError<T>) -> Self {
Error::SendError(err.to_string())
}
}
impl From<RecvError> for Error {
fn from(err: RecvError) -> Self {
Error::RecvError(err.to_string())
}
}
impl From<crossbeam::channel::RecvError> for Error {
fn from(err: crossbeam::channel::RecvError) -> Self {
Error::RecvError(err.to_string())
}
}