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
//! Error types for `linkmarks-core`.
use thiserror::Error;
/// Top-level error type for core operations.
#[derive(Debug, Error)]
pub enum CoreError {
/// A bookmark URL could not be parsed.
#[error("invalid url: {0}")]
InvalidUrl(String),
/// A canonicalization rule failed (e.g., IDN with non-ASCII host).
#[error("canonicalize failed: {0}")]
Canonicalize(String),
/// I/O error from the underlying reader/writer.
#[error("io: {0}")]
Io(#[from] std::io::Error),
/// SQLite storage error.
#[error("storage error: {0}")]
Storage(String),
/// JSON parsing error.
#[error("json: {0}")]
Json(#[from] serde_json::Error),
/// A bridge or sink reported a non-fatal element failure. The
/// `element` field carries the affected input identifier (URL or
/// external_id) for reporting.
#[error("partial failure at element {element}: {reason}")]
Partial {
/// Identifier of the offending element (URL, external_id, etc).
element: String,
/// Human-readable reason.
reason: String,
},
}