Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

feat: send error code with merge conflict error

thecodrr10ee35a145e4
diff --git a/packages/core/api/sync.js b/packages/core/api/sync.js
index d94624f79..e0641ac7d 100644
--- a/packages/core/api/sync.js
+++ b/packages/core/api/sync.js
@@ -53,10 +53,13 @@ export default class Sync {
async throwOnConflicts() {
let hasConflicts = await this.db.context.read("hasConflicts");
- if (hasConflicts)
- throw new Error(
+ if (hasConflicts) {
+ const mergeConflictError = new Error(
"Merge conflicts detected. Please resolve all conflicts to continue syncing."
);
+ mergeConflictError.code = "MERGE_CONFLICT";
+ throw mergeConflictError;
+ }
}
async start() {