File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
crates/matrix-sdk-sqlite/src Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,22 @@ macro_rules! impl_from {
119119 } ;
120120}
121121
122- impl_from ! ( rusqlite:: Error => Error :: Sqlite ) ;
122+ impl From < rusqlite:: Error > for Error {
123+ fn from ( error : rusqlite:: Error ) -> Self {
124+ if let rusqlite:: Error :: SqliteFailure ( ffi_error, message) = & error {
125+ if ffi_error. code == rusqlite:: ErrorCode :: DatabaseBusy {
126+ // Report to sentry.
127+ tracing:: error!(
128+ sentry = true ,
129+ sqlite_message = message,
130+ "observed database busy error"
131+ ) ;
132+ }
133+ }
134+ Error :: Sqlite ( error)
135+ }
136+ }
137+
123138impl_from ! ( PoolError => Error :: Pool ) ;
124139impl_from ! ( rmp_serde:: encode:: Error => Error :: Encode ) ;
125140impl_from ! ( rmp_serde:: decode:: Error => Error :: Decode ) ;
You can’t perform that action at this time.
0 commit comments