tauri_plugin_hotswap/
error.rs1#[derive(Debug, thiserror::Error)]
3#[non_exhaustive]
4pub enum Error {
5 #[error("network error: {0}")]
7 Network(String),
8
9 #[error("HTTP {status}: {message}")]
11 Http {
12 status: u16,
14 message: String,
16 },
17
18 #[error("bundle too large: {size} bytes exceeds limit of {limit} bytes")]
20 BundleTooLarge {
21 size: u64,
23 limit: u64,
25 },
26
27 #[error("signature verification failed: {0}")]
29 Signature(String),
30
31 #[error("extraction failed: {0}")]
33 Extraction(String),
34
35 #[error("invalid manifest: {0}")]
37 InvalidManifest(String),
38
39 #[error("version error: {0}")]
41 Version(String),
42
43 #[error("configuration error: {0}")]
45 Config(String),
46
47 #[error("no pending update — call check first")]
49 NoPending,
50
51 #[error("insecure URL rejected: {0} (set require_https = false to allow)")]
53 InsecureUrl(String),
54
55 #[error("I/O error: {0}")]
57 Io(#[from] std::io::Error),
58
59 #[error("serialization error: {0}")]
61 Serialization(String),
62
63 #[error("internal state error: lock poisoned")]
65 LockPoisoned,
66}
67
68impl serde::Serialize for Error {
70 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
71 where
72 S: serde::Serializer,
73 {
74 serializer.serialize_str(&self.to_string())
75 }
76}
77
78pub type Result<T> = std::result::Result<T, Error>;