handleError
open suspend fun handleError(tx: CrudTransaction, entry: CrudEntry, exception: Exception, errorCode: String?)(source)
Handles an error during the upload. This method can be overridden to log errors or customize error handling.
By default, it discards the rest of a transaction when the error code indicates that this is a fatal postgres error that can't be retried. Otherwise, it rethrows the exception so that the PowerSync SDK will retry.
Parameters
tx
The full CrudTransaction we're in the process of uploading.
entry
The CrudEntry for which an upload has failed.
exception
The Exception thrown by the Supabase client.
errorCode
The postgres error code, if any.
Throws
If the upload should be retried. If this method doesn't throw, it should mark tx as complete by invoking CrudTransaction.complete. In that case, the local write would be lost.