Skip to content

Commit

Permalink
chore: add documentation for fatal error (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicGBauer authored Dec 23, 2024
1 parent 1ad5a8b commit 7e79c11
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,14 @@ public class SupabaseConnector(
transaction.complete(null)
} catch (e: Exception) {
if (errorCode != null && PostgresFatalCodes.isFatalError(errorCode.toString())) {
/**
* Instead of blocking the queue with these errors,
* discard the (rest of the) transaction.
*
* Note that these errors typically indicate a bug in the application.
* If protecting against data loss is important, save the failing records
* elsewhere instead of discarding, and/or notify the user.
*/
Logger.e("Data upload error: ${e.message}")
Logger.e("Discarding entry: $lastEntry")
transaction.complete(null)
Expand Down

0 comments on commit 7e79c11

Please sign in to comment.