mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-03-30 13:45:19 +00:00
Tagged downstream network errors to respect networkWarningStyle setting
This commit is contained in:
@@ -116,7 +116,8 @@ export class ModuleReplicator extends AbstractModule {
|
||||
}
|
||||
// Showing message is false: that because be shown here. (And it is a fatal error, no way to hide it).
|
||||
if (!(await this.ensureReplicatorPBKDF2Salt(false))) {
|
||||
this.showError("Failed to initialise the encryption key, preventing replication.");
|
||||
//tagged as network error at beginning for error filtering with NetworkWarningStyles
|
||||
this.showError("\u{200b}Failed to initialise the encryption key, preventing replication.");
|
||||
return false;
|
||||
}
|
||||
await this.processor.restoreFromSnapshotOnce();
|
||||
@@ -218,7 +219,11 @@ Even if you choose to clean up, you will see this option again if you exit Obsid
|
||||
return false;
|
||||
}
|
||||
if (!(await this.services.replication.onBeforeReplicate(showMessage))) {
|
||||
this.showError($msg("Replicator.Message.SomeModuleFailed"), LOG_LEVEL_NOTICE);
|
||||
// check for tagged network errors for filtering by NetworkWarningStyles
|
||||
const hasNetworkError = [...this._previousErrors].some(e => e.startsWith("\u{200b}"));
|
||||
if (!hasNetworkError) {
|
||||
this.showError($msg("Replicator.Message.SomeModuleFailed"), LOG_LEVEL_NOTICE);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
this.clearErrors();
|
||||
|
||||
Reference in New Issue
Block a user