Add source annotations to errors (#1999)

This commit is contained in:
Bouke van der Bijl 2023-12-08 14:50:57 +01:00 committed by GitHub
parent 3d6124393a
commit a1396f3679
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,7 @@ use thiserror::Error;
pub enum DbErr { pub enum DbErr {
/// This error can happen when the connection pool is fully-utilized /// This error can happen when the connection pool is fully-utilized
#[error("Failed to acquire connection from pool: {0}")] #[error("Failed to acquire connection from pool: {0}")]
ConnectionAcquire(ConnAcquireErr), ConnectionAcquire(#[source] ConnAcquireErr),
/// Runtime type conversion error /// Runtime type conversion error
#[error("Error converting `{from}` into `{into}`: {source}")] #[error("Error converting `{from}` into `{into}`: {source}")]
TryIntoErr { TryIntoErr {
@ -92,7 +92,7 @@ pub enum RuntimeErr {
/// SQLx Error /// SQLx Error
#[cfg(feature = "sqlx-dep")] #[cfg(feature = "sqlx-dep")]
#[error("{0}")] #[error("{0}")]
SqlxError(sqlx::error::Error), SqlxError(#[source] sqlx::error::Error),
/// Error generated from within SeaORM /// Error generated from within SeaORM
#[error("{0}")] #[error("{0}")]
Internal(String), Internal(String),