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
//! Crate-level error type.
//!
//! [`enum@Error`] is the single error enum threaded through every fallible
//! path in the crate, paired with the [`Result`] alias. The REST layer
//! maps each variant to an HTTP status code in
//! `crate::api::rest::handlers::error_response` (`NotFound` → 404,
//! `Validation` → 422, `Conflict` → 409, everything else → 500), so the
//! variant a layer returns directly determines the response a client
//! sees.
use Error;
/// All errors the Course Service can raise.
///
/// Each variant carries a human-readable detail string (except
/// [`Error::NotFound`], which is parameterless). Variants are produced
/// at the layer named: `Config`/`Pool`/`Database` from `config` + `db`,
/// `Search` from `search`, `Matching` from `matching`, `Validation`
/// from `validation`, `Streaming` from `streaming`, and
/// `Api`/`Conflict`/`NotFound` from the REST layer.
/// Crate-wide convenience alias for `std::result::Result<T, Error>`.
///
/// Use this everywhere a function can fail with the crate's [`enum@Error`].
pub type Result<T> = Result;