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:
parent
fa5662604d
commit
daacca2c3d
@ -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
|
||||
|
||||
@ -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:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user