X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=bin%2Fkhatus_controller;fp=bin%2Fkhatus_controller;h=c56370e869f44908b6372ead2e41598e7ee54e9b;hb=0684c7865d61556e13e587dd8eaae538f3e862be;hp=60a6b19e25fd3cca85a1e4d6398b5861bb0b092e;hpb=ec80b4403b0d2ea418a281225f7f2719a609f0d3;p=khatus.git diff --git a/bin/khatus_controller b/bin/khatus_controller index 60a6b19..c56370e 100755 --- a/bin/khatus_controller +++ b/bin/khatus_controller @@ -162,7 +162,7 @@ function set_volume( mute, left, right) { } else if (mute == "yes") { db["volume"] = "X" } else { - error("Unexpected value for 'mute' field: " mute) + error("set_volume", "Unexpected value for 'mute' field: " mute) } } @@ -537,8 +537,11 @@ function debug(location, msg, values, sep, vals, key, payload) { } } -function error(msg) { - output_msg("ERROR", msg, "/dev/stderr") +function error(location, msg) { + # TODO: Reconsider classifying internal errors as alerts + # Maybe better to keep the error class distinct and provide a + # an optional transformation from error to alert + alert_trigger_hi(location, "KhatusControllerError", msg) } function ensure_numeric(n) {