Skip to content

Commit

Permalink
ADD more info to error (#6692)
Browse files Browse the repository at this point in the history
  • Loading branch information
pubkey authored Dec 23, 2024
1 parent e045257 commit 9a5c3c9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/replication-protocol/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import { docStateToWriteDoc, getUnderlyingPersistentStorage, writeDocToDocState
import { startReplicationUpstream } from './upstream.ts';
import { fillWriteDataForAttachmentsChange } from '../plugins/attachments/index.ts';
import { getChangedDocumentsSince } from '../rx-storage-helper.ts';
import { newRxError } from '../rx-error.ts';


export * from './checkpoint.ts';
Expand Down Expand Up @@ -298,7 +299,10 @@ export function rxStorageInstanceToReplicationHandler<RxDocType, MasterCheckpoin

result.error.forEach(err => {
if (err.status !== 409) {
throw new Error('non conflict error');
throw newRxError('SNH', {
name: 'non conflict error',
error: err as any
});
} else {
conflicts.push(
writeDocToDocState(ensureNotFalsy(err.documentInDb), hasAttachments, keepMeta)
Expand Down

0 comments on commit 9a5c3c9

Please sign in to comment.