From 2b4cf5c62ff82fa408a4f82bde0b561ff3b15497 Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Wed, 18 Sep 2024 02:22:09 -0400 Subject: Make BoxedError an implementation detail of InternalError. --- src/cli.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/cli.rs') diff --git a/src/cli.rs b/src/cli.rs index 641f99f..308e91f 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -6,9 +6,9 @@ use clap::Parser; use sqlx::sqlite::{SqliteConnectOptions, SqlitePool, SqlitePoolOptions}; use tokio::net; -use crate::{app::App, channel, clock, error::BoxedError, events, index, login}; +use crate::{app::App, channel, clock, events, index, login}; -pub type Result = std::result::Result; +pub type Result = std::result::Result; #[derive(Parser)] pub struct Args { @@ -73,3 +73,13 @@ fn started_msg(listener: &net::TcpListener) -> io::Result { let local_addr = listener.local_addr()?; Ok(format!("listening on http://{local_addr}/")) } + +#[derive(Debug, thiserror::Error)] +pub enum Error { + #[error("io error: {0}")] + IoError(#[from] io::Error), + #[error("database error: {0}")] + DatabaseError(#[from] sqlx::Error), + #[error("database migration error: {0}")] + MigrateError(#[from] sqlx::migrate::MigrateError), +} -- cgit v1.2.3