Download backend/snap-os/bifrost/src/error.rs from Snapkitty/snapkitty-clojure-lisp-bridge: direct link, hf CLI and curl.
- Browser
- Download file 1.54 kB
-
https://huggingface.co/Snapkitty/snapkitty-clojure-lisp-bridge/resolve/main/backend/snap-os/bifrost/src/error.rs
- Command line
-
hf download hf://Snapkitty/snapkitty-clojure-lisp-bridge/backend/snap-os/bifrost/src/error.rs
-
curl -L -o error.rs https://huggingface.co/Snapkitty/snapkitty-clojure-lisp-bridge/resolve/main/backend/snap-os/bifrost/src/error.rs
1.54 kB
| //! `BifrostError` — the single error type for the entire bifrost crate. | |
| //! | |
| //! # Design contract | |
| //! Every fallible bifrost operation returns `Result<T, BifrostError>`. | |
| //! Callers MUST treat `WormViolation` as a security event — it means something | |
| //! attempted to overwrite a sealed, content-addressed blob. | |
| use thiserror::Error; | |
| pub enum BifrostError { | |
| Io( std::io::Error), | |
| Json( serde_json::Error), | |
| Sled( sled::Error), | |
| CidMismatch { expected: String, computed: String }, | |
| /// A blob whose CID is already in WORM_FS was presented for sealing again. | |
| /// This MUST be logged as a security event upstream. | |
| WormViolation { cid: String }, | |
| NotFound { cid: String }, | |
| BadSignature { cid: String }, | |
| BrokenChain { cid: String, prev: Option<String> }, | |
| GenesisExists, | |
| EmptyChain, | |
| Serialize(String), | |
| } | |
| pub type BifrostResult<T> = Result<T, BifrostError>; | |