Skip to content

Commit

Permalink
fix: decode error code for replicated documents (#540)
Browse files Browse the repository at this point in the history
  • Loading branch information
blaugold committed Dec 20, 2023
1 parent a68456e commit 935c36e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/cbl_ffi/lib/src/replicator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -451,11 +451,11 @@ class DocumentReplicationsCallbackMessage {
documents.cast<List<Object?>>().map((document) {
CBLErrorException? error;
if (document.length > 4) {
error = CBLErrorException(
(document[4] as int).toErrorDomain(),
document[5] as int,
utf8.decode(document[6] as Uint8List, allowMalformed: true),
);
final domain = (document[4] as int).toErrorDomain();
final code = (document[5] as int).toErrorCode(domain);
final message =
utf8.decode(document[6] as Uint8List, allowMalformed: true);
error = CBLErrorException(domain, code, message);
}

return CBLReplicatedDocument(
Expand Down

0 comments on commit 935c36e

Please sign in to comment.