diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2024-09-18 02:22:09 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2024-09-18 12:18:45 -0400 |
| commit | 2b4cf5c62ff82fa408a4f82bde0b561ff3b15497 (patch) | |
| tree | 66d1d695a54eef27c4509fb2f5e7e8372a96ba1e /src/cli.rs | |
| parent | cce6662d635bb2115f9f2a7bab92cc105166e761 (diff) | |
Make BoxedError an implementation detail of InternalError.
Diffstat (limited to 'src/cli.rs')
| -rw-r--r-- | src/cli.rs | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -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<T> = std::result::Result<T, BoxedError>; +pub type Result<T> = std::result::Result<T, Error>; #[derive(Parser)] pub struct Args { @@ -73,3 +73,13 @@ fn started_msg(listener: &net::TcpListener) -> io::Result<String> { 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), +} |
