Commit 62352cbd authored by Ad Schellevis's avatar Ad Schellevis

(trafficshaper) improve error handling

parent c85b9ed2
...@@ -49,7 +49,12 @@ class ServiceController extends ApiControllerBase ...@@ -49,7 +49,12 @@ class ServiceController extends ApiControllerBase
$backend = new Backend(); $backend = new Backend();
$backend->configdRun("template reload OPNsense.IPFW"); $backend->configdRun("template reload OPNsense.IPFW");
$status = $backend->configdRun("ipfw reload"); $bckresult = trim($backend->configdRun("ipfw reload"));
if ($bckresult == "OK") {
$status = "ok";
} else {
$status = "error reloading shaper (".$bckresult.")";
}
return array("status" => $status); return array("status" => $status);
} else { } else {
......
...@@ -254,7 +254,7 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -254,7 +254,7 @@ POSSIBILITY OF SUCH DAMAGE.
BootstrapDialog.show({ BootstrapDialog.show({
type: BootstrapDialog.TYPE_WARNING, type: BootstrapDialog.TYPE_WARNING,
title: "Error reconfiguring trafficshaper", title: "Error reconfiguring trafficshaper",
message: JSON.stringify(data), message: data['status'],
draggable: true draggable: true
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment