Commit be0e9b3 1 parent a6cda33 commit be0e9b3 Copy full SHA for be0e9b3
File tree 2 files changed +4
-21
lines changed
editoast/editoast_models/src
2 files changed +4
-21
lines changed Original file line number Diff line number Diff line change @@ -131,20 +131,8 @@ impl Default for DbConnectionPoolV2 {
131
131
pub struct DatabasePoolBuildError ( #[ from] diesel_async:: pooled_connection:: deadpool:: BuildError ) ;
132
132
133
133
#[ derive( Debug , thiserror:: Error ) ]
134
- pub enum DatabasePoolError {
135
- #[ error( "an error occurred while getting a connection from the database pool: '{0}'" ) ]
136
- Pool ( #[ from] diesel_async:: pooled_connection:: deadpool:: PoolError ) ,
137
- #[ error( "an error occured while querying the database: {0}" ) ]
138
- DieselError ( #[ from] diesel:: result:: Error ) ,
139
- }
140
-
141
- #[ derive( Debug , thiserror:: Error ) ]
142
- pub enum DatabaseTransactionError {
143
- #[ error( "an error occurred while getting a connection from the database pool: '{0}'" ) ]
144
- Pool ( #[ from] DatabasePoolError ) ,
145
- #[ error( "an error occured while querying the database: {0}" ) ]
146
- DieselError ( #[ from] diesel:: result:: Error ) ,
147
- }
134
+ #[ error( "an error occurred while getting a connection from the database pool: '{0}'" ) ]
135
+ pub struct DatabasePoolError ( #[ from] diesel_async:: pooled_connection:: deadpool:: PoolError ) ;
148
136
149
137
impl DbConnectionPoolV2 {
150
138
/// Get inner pool for retro compatibility
Original file line number Diff line number Diff line change 1
- use db_connection_pool:: DatabasePoolError ;
2
1
use diesel_async:: pooled_connection:: deadpool:: Pool ;
3
2
use diesel_async:: AsyncPgConnection ;
4
3
@@ -15,9 +14,5 @@ pub type DbConnectionPool = Pool<DieselConnection>;
15
14
///
16
15
/// Useful for functions which only points of failure are the DB calls.
17
16
#[ derive( Debug , thiserror:: Error ) ]
18
- pub enum DatabaseError {
19
- #[ error( "an error occured while querying the database: {0}" ) ]
20
- DieselError ( #[ from] diesel:: result:: Error ) ,
21
- #[ error( "an error occured while retrieving a connection from the pool: {0}" ) ]
22
- DatabasePoolError ( #[ from] DatabasePoolError ) ,
23
- }
17
+ #[ error( "an error occured while querying the database: {0}" ) ]
18
+ pub struct DatabaseError ( #[ from] diesel:: result:: Error ) ;
You can’t perform that action at this time.
0 commit comments