luci-base: network.js: gracefully handle deleteConfiguration() rejects

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2020-03-03 21:30:32 +01:00
parent 890dcac2de
commit d5f30d335f

View file

@ -1021,6 +1021,8 @@ Network = L.Class.extend(/** @lends LuCI.Network.prototype */ {
return L.firewall.deleteNetwork(name).then(function() { return true }); return L.firewall.deleteNetwork(name).then(function() { return true });
return true; return true;
}).catch(function() {
return false;
}); });
} }
@ -2657,7 +2659,8 @@ Protocol = L.Class.extend(/** @lends LuCI.Network.Protocol.prototype */ {
* @returns {*|Promise<*>} * @returns {*|Promise<*>}
* This function may return a promise which is awaited before the rest of * This function may return a promise which is awaited before the rest of
* the configuration is removed. Any non-promise return value and any * the configuration is removed. Any non-promise return value and any
* resolved promise value is ignored. * resolved promise value is ignored. If the returned promise is rejected,
* the interface removal will be aborted.
*/ */
deleteConfiguration: function() {} deleteConfiguration: function() {}
}); });