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
//! Error types for the contributor-profile pipeline.
//!
//! Why: the profile pipeline spans DB queries, git operations, and tga library
//! calls — each with different failure modes. A dedicated error enum lets
//! callers pattern-match on the failure kind (e.g. missing identity vs. DB
//! failure vs. bad config) without leaking tga internal types into the
//! trusty-review API surface.
//! What: defines [`ProfileError`] and the [`Result`] alias used throughout
//! `src/profile/`.
//! Test: constructors and `Display` impls are covered by the selector / batch /
//! diff-sampler unit tests indirectly; the `not_found` variant is exercised by
//! `selector::tests::identity_not_found`.
use Error;
/// Errors that can occur in the contributor-profile pipeline.
///
/// Why: typed variants allow callers to surface actionable messages — e.g.
/// `ContributorNotFound` tells the user to run `tga aliases list`, while
/// `Db` surfaces the underlying SQLite failure.
/// What: covers identity resolution, database access, git diff extraction,
/// configuration errors, and tga-layer report errors.
/// Test: each variant is exercised by at least one test in the selector,
/// batch, or diff-sampler modules.
/// Convenience `Result` alias for the profile pipeline.
///
/// Why: avoids repeating `Result<T, ProfileError>` at every call site.
/// What: aliases `std::result::Result<T, ProfileError>`.
/// Test: used transitively by all profile-pipeline functions.
pub type Result<T> = Result;