From: Jo-Philipp Wich Date: Tue, 3 Mar 2020 20:30:32 +0000 (+0100) Subject: luci-base: network.js: gracefully handle deleteConfiguration() rejects X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=30972e159d11217f2eaefed490bc1d18ff600744;p=oweals%2Fluci.git luci-base: network.js: gracefully handle deleteConfiguration() rejects Signed-off-by: Jo-Philipp Wich (cherry picked from commit d5f30d335ff0651a3291e350602cba7409cf1e4a) --- diff --git a/modules/luci-base/htdocs/luci-static/resources/network.js b/modules/luci-base/htdocs/luci-static/resources/network.js index b4694e0f1..8c34b4cfe 100644 --- a/modules/luci-base/htdocs/luci-static/resources/network.js +++ b/modules/luci-base/htdocs/luci-static/resources/network.js @@ -1021,6 +1021,8 @@ Network = L.Class.extend(/** @lends LuCI.Network.prototype */ { return L.firewall.deleteNetwork(name).then(function() { return true }); return true; + }).catch(function() { + return false; }); } @@ -2657,7 +2659,8 @@ Protocol = L.Class.extend(/** @lends LuCI.Network.Protocol.prototype */ { * @returns {*|Promise<*>} * This function may return a promise which is awaited before the rest of * 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() {} });