- Replace .unwrap() on Mutex lock with proper error propagation - Add worktree_path and branch_name columns to processed_tickets - Add style-src to CSP for Tailwind compatibility - Implement std::error::Error for AppError - Check affected row count in update/delete operations - Handle non-UTF-8 paths in git clone Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
36 lines
719 B
Rust
36 lines
719 B
Rust
use serde::Serialize;
|
|
|
|
#[derive(Debug, Serialize)]
|
|
pub struct AppError {
|
|
pub message: String,
|
|
}
|
|
|
|
impl From<rusqlite::Error> for AppError {
|
|
fn from(e: rusqlite::Error) -> Self {
|
|
AppError {
|
|
message: e.to_string(),
|
|
}
|
|
}
|
|
}
|
|
|
|
impl From<std::io::Error> for AppError {
|
|
fn from(e: std::io::Error) -> Self {
|
|
AppError {
|
|
message: e.to_string(),
|
|
}
|
|
}
|
|
}
|
|
|
|
impl From<String> for AppError {
|
|
fn from(s: String) -> Self {
|
|
AppError { message: s }
|
|
}
|
|
}
|
|
|
|
impl std::fmt::Display for AppError {
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
write!(f, "{}", self.message)
|
|
}
|
|
}
|
|
|
|
impl std::error::Error for AppError {}
|