feat: add transcription backend contracts

This commit is contained in:
Evandro committed 2026-06-10 20:55:10 -03:00
1 parent 3b05cb22a0
commit 54e8b42330
9 files changed
+461

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
use serde::Serialize;
use thiserror::Error;
pub type AppResult<T> = Result<T, AppError>;
#[derive(Debug, Error, Serialize, Clone, PartialEq, Eq)]
#[serde(tag = "code", content = "message")]
pub enum AppError {
#[error("modelo offline não instalado: {0}")]
ModelNotInstalled(String),
#[error("sidecar CrispASR não configurado")]
SidecarNotConfigured,
#[error("gravação já está em andamento")]
RecordingAlreadyActive,
#[error("nenhuma gravação ativa")]
NoActiveRecording,
#[error("operação ainda não suportada neste ambiente: {0}")]
Unsupported(String),
#[error("erro de configuração: {0}")]
Configuration(String),
}
impl From<AppError> for String {
fn from(value: AppError) -> Self {
value.to_string()
}
}