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:
@@ -8,7 +8,7 @@ use regex::Regex;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::sync::OnceLock;
|
||||
|
||||
use lumotia_core::error::{MagnotiaError, Result};
|
||||
use lumotia_core::error::{Error, Result};
|
||||
|
||||
const AUDIO_CHANNEL_CAPACITY: usize = 32;
|
||||
|
||||
@@ -106,7 +106,7 @@ impl MicrophoneCapture {
|
||||
|
||||
let devices = host
|
||||
.input_devices()
|
||||
.map_err(|e| MagnotiaError::AudioCaptureFailed(format!("input_devices: {e}")))?;
|
||||
.map_err(|e| Error::AudioCaptureFailed(format!("input_devices: {e}")))?;
|
||||
|
||||
// Load ALSA card descriptions once per enumeration. These are the
|
||||
// "real" product names (e.g. "Blue Microphones") that cpal's
|
||||
@@ -144,7 +144,7 @@ impl MicrophoneCapture {
|
||||
let host = cpal::default_host();
|
||||
let devices = host
|
||||
.input_devices()
|
||||
.map_err(|e| MagnotiaError::AudioCaptureFailed(format!("input_devices: {e}")))?;
|
||||
.map_err(|e| Error::AudioCaptureFailed(format!("input_devices: {e}")))?;
|
||||
|
||||
for device in devices {
|
||||
let name = device_display_name(&device).unwrap_or_default();
|
||||
@@ -154,7 +154,7 @@ impl MicrophoneCapture {
|
||||
}
|
||||
}
|
||||
|
||||
Err(MagnotiaError::AudioCaptureFailed(format!(
|
||||
Err(Error::AudioCaptureFailed(format!(
|
||||
"Selected device '{device_name}' not found in current host enumeration. \
|
||||
It may have been disconnected. Open Settings → Audio to pick another."
|
||||
)))
|
||||
@@ -178,7 +178,7 @@ impl MicrophoneCapture {
|
||||
|
||||
let mut all_devices: Vec<cpal::Device> = host
|
||||
.input_devices()
|
||||
.map_err(|e| MagnotiaError::AudioCaptureFailed(format!("input_devices: {e}")))?
|
||||
.map_err(|e| Error::AudioCaptureFailed(format!("input_devices: {e}")))?
|
||||
.collect();
|
||||
|
||||
// Sort: default first, then non-monitor, then monitor-as-last-resort.
|
||||
@@ -237,7 +237,7 @@ impl MicrophoneCapture {
|
||||
}
|
||||
}
|
||||
|
||||
Err(MagnotiaError::AudioCaptureFailed(
|
||||
Err(Error::AudioCaptureFailed(
|
||||
"No working microphone found. Check that an input device is connected, \
|
||||
that PulseAudio/PipeWire is running, and that the app has microphone permission. \
|
||||
Then open Settings → Audio to pick a device explicitly."
|
||||
@@ -361,7 +361,7 @@ fn open_and_validate(
|
||||
) -> Result<(MicrophoneCapture, mpsc::Receiver<AudioChunk>)> {
|
||||
let config = device
|
||||
.default_input_config()
|
||||
.map_err(|e| MagnotiaError::AudioCaptureFailed(format!("default_input_config: {e}")))?;
|
||||
.map_err(|e| Error::AudioCaptureFailed(format!("default_input_config: {e}")))?;
|
||||
let sample_rate = config.sample_rate();
|
||||
let channels = config.channels();
|
||||
let format = config.sample_format();
|
||||
@@ -422,16 +422,16 @@ fn open_and_validate(
|
||||
name.to_string(),
|
||||
),
|
||||
other => {
|
||||
return Err(MagnotiaError::AudioCaptureFailed(format!(
|
||||
return Err(Error::AudioCaptureFailed(format!(
|
||||
"unsupported sample format {other:?}"
|
||||
)))
|
||||
}
|
||||
}
|
||||
.map_err(|e| MagnotiaError::AudioCaptureFailed(format!("build_input_stream: {e}")))?;
|
||||
.map_err(|e| Error::AudioCaptureFailed(format!("build_input_stream: {e}")))?;
|
||||
|
||||
stream
|
||||
.play()
|
||||
.map_err(|e| MagnotiaError::AudioCaptureFailed(format!("stream.play: {e}")))?;
|
||||
.map_err(|e| Error::AudioCaptureFailed(format!("stream.play: {e}")))?;
|
||||
|
||||
// Validation window: collect chunks for DEVICE_VALIDATION_MS, compute RMS.
|
||||
let deadline =
|
||||
@@ -460,7 +460,7 @@ fn open_and_validate(
|
||||
}
|
||||
|
||||
if total_samples == 0 {
|
||||
return Err(MagnotiaError::AudioCaptureFailed(
|
||||
return Err(Error::AudioCaptureFailed(
|
||||
"device delivered zero samples in validation window".into(),
|
||||
));
|
||||
}
|
||||
@@ -475,7 +475,7 @@ fn open_and_validate(
|
||||
);
|
||||
|
||||
if require_audio && rms < SILENCE_RMS_FLOOR {
|
||||
return Err(MagnotiaError::AudioCaptureFailed(format!(
|
||||
return Err(Error::AudioCaptureFailed(format!(
|
||||
"device produced silence (rms={rms:.6} below floor {SILENCE_RMS_FLOOR:.6})"
|
||||
)));
|
||||
}
|
||||
@@ -485,7 +485,7 @@ fn open_and_validate(
|
||||
// long stream of f32 zeros from a borked device — that is worse than
|
||||
// failing fast.
|
||||
if rms < DEAD_SILENCE_FLOOR {
|
||||
return Err(MagnotiaError::AudioCaptureFailed(format!(
|
||||
return Err(Error::AudioCaptureFailed(format!(
|
||||
"device produced dead silence (rms={rms:.6e} below absolute floor {DEAD_SILENCE_FLOOR:.6e})"
|
||||
)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user