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
/// Core error type for direct provider use.
///
/// Wraps provider-specific errors so callers can handle them uniformly
/// when working with `TmdbClient` or `AniListClient` directly.
///
/// Most applications should use the [`crate::unified::CameoClient`] facade
/// instead, which returns [`crate::unified::CameoClientError`]. That type
/// adds `NoProviders` and `Cache` variants on top of provider errors and
/// is the recommended entry point for error handling.
///
/// # Matching on variants
///
/// ```no_run
/// # #[cfg(feature = "tmdb")]
/// # {
/// use cameo::core::error::CameoError;
/// use cameo::TmdbError;
///
/// fn handle(err: CameoError) {
/// match err {
/// CameoError::Tmdb(TmdbError::Api { status: 401, .. }) => {
/// eprintln!("authentication failed — check your token");
/// }
/// CameoError::Tmdb(TmdbError::Api { status, message }) => {
/// eprintln!("TMDB API error {status}: {message}");
/// }
/// CameoError::Tmdb(TmdbError::Http(e)) => {
/// eprintln!("network error: {e}");
/// }
/// other => eprintln!("other error: {other}"),
/// }
/// }
/// # }
/// ```