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
use Display;
/// Enum describing errors that can be returned from struct builders.
/// ```
/// use lemon_bugsnag_rs::common::builder::client_builder::ClientBuilder;
/// use lemon_bugsnag_rs::common::traits::decider_trait_sync::DeciderTraitSync;
/// use lemon_bugsnag_rs::common::traits::backend_builder_trait_sync::BackendBuilderTraitSync;
/// use lemon_bugsnag_rs::common::error::ErrorType;
/// use lemon_bugsnag_rs::common::builder::error::BuilderError;
///
/// let builder = ClientBuilder::error().reqwest().blocking();
/// match builder.build() {
/// Ok(_) => {
/// // The result will not be OK, because you have not configured
/// // all required fields, such as the notifier and events fields.
/// },
/// Err(err) => {
/// match err.error_type() {
/// ErrorType::ClientBuildError(variant) => {
/// // Do your error handling and reporting here.
/// match variant {
/// BuilderError::MissingField { context, fields } => {
/// // Handle missing fields.
/// },
/// BuilderError::ConflictingField { context, fields } => {
/// // Handle conflicting fields.
/// },
/// _ => {
/// // There are no other variants to handle. This is
/// // only here to demonstrate that you would continue
/// // processing variants as necessary.
/// }
/// }
/// },
/// _ => {
/// // There are other error types, but none relevant to
/// // this example.
/// }
/// }
/// },
/// }
/// ```