agent: lumotia-rebrand — drop MagnotiaError prefix, now lumotia_core::Error
Phase 3 of the rebrand cascade per locked decision D4. MagnotiaError -> Error in crates/core/src/error.rs (the crate name already qualifies it). 92 usages across 14 .rs files renamed via word-boundary sed. One collision required disambiguation: lumotia_storage already had its own local Error type (introduced by the slop-pass Area A residuals work). crates/storage/src/error.rs aliases the imported core error as CoreError on import; the From<Error> for CoreError boundary impl and the CoreError::Storage construction site use the alias. cargo build --workspace passes. cargo test --workspace: 330 pass, 0 fail. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
//! Storage-local typed error.
|
||||
//!
|
||||
//! Backend code that wants to branch on storage failure modes pattern-matches
|
||||
//! on [`Error`] directly. The crate boundary into [`lumotia_core::error::MagnotiaError`]
|
||||
//! flattens this into a [`MagnotiaError::Storage`] variant carrying a serde-friendly
|
||||
//! on [`Error`] directly. The crate boundary into [`lumotia_core::error::Error`]
|
||||
//! flattens this into a [`Error::Storage`] variant carrying a serde-friendly
|
||||
//! `kind`, an `operation` label, and the Display output as `detail` — so the
|
||||
//! frontend (which still receives stringified errors from Tauri commands today)
|
||||
//! keeps working, and Area E can later expose the typed `kind` to the FE without
|
||||
@@ -14,7 +14,7 @@
|
||||
use std::borrow::Cow;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use lumotia_core::error::{MagnotiaError, StorageKind};
|
||||
use lumotia_core::error::{Error as CoreError, StorageKind};
|
||||
|
||||
/// Kinds of database-open operation that can fail before the pool is ready.
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
@@ -145,7 +145,7 @@ pub enum Error {
|
||||
}
|
||||
|
||||
impl Error {
|
||||
/// Discriminator for the boundary conversion into [`MagnotiaError`].
|
||||
/// Discriminator for the boundary conversion into [`Error`].
|
||||
pub fn kind(&self) -> StorageKind {
|
||||
match self {
|
||||
Error::DatabaseOpen { .. } => StorageKind::DatabaseOpen,
|
||||
@@ -157,7 +157,7 @@ impl Error {
|
||||
}
|
||||
}
|
||||
|
||||
/// Operation label that flows into the [`MagnotiaError::Storage`] boundary
|
||||
/// Operation label that flows into the [`Error::Storage`] boundary
|
||||
/// shape. For per-query failures this is the caller-provided label;
|
||||
/// for the other variants it's the variant's intrinsic label.
|
||||
pub fn operation_label(&self) -> Cow<'static, str> {
|
||||
@@ -175,14 +175,14 @@ impl Error {
|
||||
}
|
||||
|
||||
/// Boundary conversion — flattens the typed error into the wire-friendly
|
||||
/// [`MagnotiaError::Storage`] variant. Lives in the storage crate (not in core)
|
||||
/// [`CoreError::Storage`] variant. Lives in the storage crate (not in core)
|
||||
/// to avoid a `core -> storage` dependency cycle.
|
||||
impl From<Error> for MagnotiaError {
|
||||
impl From<Error> for CoreError {
|
||||
fn from(error: Error) -> Self {
|
||||
let kind = error.kind();
|
||||
let operation = error.operation_label().into_owned();
|
||||
let detail = error.to_string();
|
||||
MagnotiaError::Storage {
|
||||
CoreError::Storage {
|
||||
kind,
|
||||
operation,
|
||||
detail,
|
||||
|
||||
Reference in New Issue
Block a user