From 8518a63f55153e7f45fd49ad6caff5555f4e374f Mon Sep 17 00:00:00 2001 From: elvis Date: Sat, 26 Sep 2026 20:20:19 -0300 Subject: Translate code, comments, logs and terminal UI to English; add English README; rename scripts --- crates/asist-core/src/error.rs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'crates/asist-core/src/error.rs') diff --git a/crates/asist-core/src/error.rs b/crates/asist-core/src/error.rs index b559bee..f0dfbe2 100644 --- a/crates/asist-core/src/error.rs +++ b/crates/asist-core/src/error.rs @@ -2,12 +2,12 @@ use std::fmt; pub type Result = std::result::Result; -/// Un fallo de una etapa del pipeline. El orquestador decide si es fatal o si -/// basta con abortar el turno en curso, así que el error lleva esa distinción -/// en lugar de dejarla al criterio de quien lo recibe. +/// A failure in a pipeline stage. The orchestrator decides whether it is +/// fatal or whether aborting the current turn is enough, so the error carries +/// that distinction instead of leaving it to whoever receives it. #[derive(Debug, thiserror::Error)] pub enum Error { - #[error("configuración inválida: {0}")] + #[error("invalid configuration: {0}")] Config(String), #[error("audio: {0}")] @@ -22,24 +22,24 @@ pub enum Error { #[error("TTS: {0}")] Tts(String), - #[error("HTTP {status} en {url}: {body}")] + #[error("HTTP {status} at {url}: {body}")] Http { status: u16, url: String, body: String, }, - #[error("transporte hacia {url}: {source}")] + #[error("transport to {url}: {source}")] Transport { url: String, #[source] source: std::io::Error, }, - #[error("herramienta «{tool}»: {message}")] + #[error("tool «{tool}»: {message}")] Tool { tool: String, message: String }, - #[error("operación cancelada")] + #[error("operation cancelled")] Cancelled, #[error(transparent)] @@ -50,17 +50,17 @@ pub enum Error { } impl Error { - /// Un error fatal tumba el asistente; el resto sólo aborta el turno. + /// A fatal error brings the assistant down; the rest only abort the turn. /// - /// Los servidores locales se caen y se reinician, y el usuario prefiere - /// oír «no te he entendido» a que el proceso muera, así que sólo la - /// configuración y el audio (que no se pueden reintentar) son fatales. + /// The local servers crash and restart, and the user would rather hear «no + /// te he entendido» than have the process die, so only configuration and + /// audio (which cannot be retried) are fatal. pub fn is_fatal(&self) -> bool { matches!(self, Error::Config(_) | Error::Audio(_)) } - /// `true` cuando reintentar tiene sentido: el servidor aún está cargando - /// el modelo, o se ha caído la conexión a mitad de una petición. + /// `true` when retrying makes sense: the server is still loading the + /// model, or the connection dropped mid-request. pub fn is_retryable(&self) -> bool { match self { Error::Transport { .. } => true, @@ -70,7 +70,7 @@ impl Error { } } -/// Contexto legible para los `Result` que cruzan una frontera de crate. +/// Readable context for `Result`s that cross a crate boundary. pub trait Context { fn ctx(self, f: impl FnOnce() -> String) -> Result; } -- cgit v1.2.3