fix(crowdsec-wizard): Handle XHR abort in bouncer and services steps

Service restarts during bouncer registration and service start can
cause XHR connections to abort. Treat these as success since the
operation likely completed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
CyberMind-FR 2026-01-13 13:44:57 +01:00
parent fa5662604d
commit daacca2c3d
2 changed files with 13 additions and 1 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-crowdsec-dashboard
PKG_VERSION:=0.7.0
PKG_RELEASE:=22
PKG_RELEASE:=23
PKG_ARCH:=all
PKG_LICENSE:=Apache-2.0

View File

@ -728,6 +728,12 @@ return view.extend({
]).then(function() {
return { success: true };
});
}).catch(function(err) {
// XHR abort during service restart is OK
if (err.message && err.message.indexOf('abort') !== -1) {
return { success: true };
}
throw err;
});
case 'services':
@ -738,6 +744,12 @@ return view.extend({
return new Promise(function(resolve) { setTimeout(resolve, 2000); });
}).then(function() {
return { success: true };
}).catch(function(err) {
// XHR abort during service restart is OK
if (err.message && err.message.indexOf('abort') !== -1) {
return { success: true };
}
throw err;
});
default: