File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -674,12 +674,19 @@ impl ErrorMetadataAnyhowExt for anyhow::Error {
674
674
let as_string = self . to_string ( ) ;
675
675
// Just doing this as a quick hack because sqlx::query has 100 throw sites.
676
676
// Ideally, we would wrap sqlx and do handling there, but punting to save time.
677
- let occs = [
677
+ let postgres_occs = [
678
678
"could not serialize access due to read/write dependencies among transactions" ,
679
679
"could not serialize access due to concurrent update" ,
680
680
] ;
681
- if occs. into_iter ( ) . any ( |occ| as_string. contains ( occ) ) {
682
- return self . context ( ErrorMetadata :: system_occ ( ) ) . context ( as_string) ;
681
+ if let Some ( occ) = postgres_occs
682
+ . into_iter ( )
683
+ . find ( |occ| as_string. contains ( occ) )
684
+ {
685
+ // Classify postgres occ as overloaded. ErrorMetadata::OCC is specific to the
686
+ // application level inside convex backend.
687
+ return self
688
+ . context ( ErrorMetadata :: overloaded ( "PostgresOcc" , occ) )
689
+ . context ( as_string) ;
683
690
}
684
691
685
692
self
You can’t perform that action at this time.
0 commit comments