Skip to content

Build your personal knowledge base with Trilium Notes

fix detection of sync connection issue with new error code

zadam51bede6541b5
diff --git a/src/services/sync.js b/src/services/sync.js
index 6036e24fe4..f297638c73 100644
--- a/src/services/sync.js
+++ b/src/services/sync.js
@@ -49,7 +49,7 @@ async function sync() {
catch (e) {
proxyToggle = !proxyToggle;
- if (e.message && e.message.indexOf('ECONNREFUSED') !== -1) {
+ if (e.message && (e.message.includes('ECONNREFUSED') || e.message.includes('ERR_CONNECTION_REFUSED'))) {
log.info("No connection to sync server.");
return {