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
use std::{io, result};
quick_error! {
#[derive(Debug)]
pub enum Error {
IoError(err: io::Error) {
description("io error")
display("I/O error: {}", err)
cause(err)
from()
}
IllegalInit {
description("illegal initialization")
display("Wkhtmltopdf may not be initialized more than once per process")
}
NotInitialized {
description("not initialized")
display("Wkhtmltopdf is not currently initialized")
}
Blocked {
description("wkhtmltopdf blocked")
display("Wkhtmltopdf is currently blocked by another initialized instance")
}
ThreadMismatch(before: usize, after: usize) {
description("thread mismatch")
display("Wkhtmltopdf originally started on thread {:0x}, cannot recreate on thread {:0x}", before, after)
}
ConversionFailed(msg: String) {
description("conversion failed")
display("Conversion failed: {}", msg)
}
GlobalSettingFailure(name: String, value: String) {
description("global setting failure")
display("Failed to update global setting '{}'='{}'", name, value)
}
ObjectSettingFailure(name: String, value: String) {
description("object setting failure")
display("Failed to update object setting '{}'='{}'", name, value)
}
}
}
pub type Result<T> = result::Result<T, Error>;