@@ -216,24 +216,36 @@ impl GetErrorHandling for Error {
216216 } )
217217 . log_warning ( )
218218 }
219- // Can't pattern match on `err` without adding a dep on the sqlite3-sys crate,
220- // so we just use a `if` guard.
221- Error :: SqlError ( rusqlite:: Error :: SqliteFailure ( err, _) )
222- if err. code == rusqlite:: ErrorCode :: DatabaseBusy =>
223- {
224- ErrorHandling :: convert ( PlacesApiError :: PlacesConnectionBusy {
225- reason : self . to_string ( ) ,
226- } )
227- . log_warning ( )
228- }
229- Error :: SqlError ( rusqlite:: Error :: SqliteFailure ( err, _) )
230- if err. code == rusqlite:: ErrorCode :: OperationInterrupted =>
231- {
232- ErrorHandling :: convert ( PlacesApiError :: OperationInterrupted {
219+ Error :: SqlError ( rusqlite:: Error :: SqliteFailure ( err, _) ) => match err. code {
220+ rusqlite:: ErrorCode :: DatabaseBusy => {
221+ ErrorHandling :: convert ( PlacesApiError :: PlacesConnectionBusy {
222+ reason : self . to_string ( ) ,
223+ } )
224+ . log_warning ( )
225+ }
226+ rusqlite:: ErrorCode :: OperationInterrupted => {
227+ ErrorHandling :: convert ( PlacesApiError :: OperationInterrupted {
228+ reason : self . to_string ( ) ,
229+ } )
230+ . log_info ( )
231+ }
232+ rusqlite:: ErrorCode :: DatabaseCorrupt => {
233+ ErrorHandling :: convert ( PlacesApiError :: UnexpectedPlacesException {
234+ reason : self . to_string ( ) ,
235+ } )
236+ . report_error ( "places-db-corrupt" )
237+ }
238+ rusqlite:: ErrorCode :: DiskFull => {
239+ ErrorHandling :: convert ( PlacesApiError :: UnexpectedPlacesException {
240+ reason : self . to_string ( ) ,
241+ } )
242+ . report_error ( "places-db-disk-full" )
243+ }
244+ _ => ErrorHandling :: convert ( PlacesApiError :: UnexpectedPlacesException {
233245 reason : self . to_string ( ) ,
234246 } )
235- . log_info ( )
236- }
247+ . report_error ( "places-unexpected" ) ,
248+ } ,
237249 Error :: InterruptedError ( err) => {
238250 // Can't unify with the above ... :(
239251 ErrorHandling :: convert ( PlacesApiError :: OperationInterrupted {
0 commit comments