summaryrefslogtreecommitdiffstats
path: root/src/cli/main.vala
diff options
context:
space:
mode:
authorSebastian Reichel <sre@ring0.de>2018-06-28 01:03:02 +0200
committerSebastian Reichel <sre@ring0.de>2018-06-28 01:53:40 +0200
commitf466538a3527cd539c732d3abee481fa7a34fc2f (patch)
tree0a244c5b3594ee42d25744bdbdd3f0a44595c87b /src/cli/main.vala
parentc70d626e473c8cbdbd87125a256ca221c0c3fa23 (diff)
downloadserial-barcode-scanner-f466538a3527cd539c732d3abee481fa7a34fc2f.tar.bz2
all: Add DBusError to avoid warnings with valac 0.40
Diffstat (limited to 'src/cli/main.vala')
-rw-r--r--src/cli/main.vala8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cli/main.vala b/src/cli/main.vala
index a3208dd..377efa1 100644
--- a/src/cli/main.vala
+++ b/src/cli/main.vala
@@ -42,7 +42,11 @@ public static int main(string[] args) {
void on_name_aquired() {
foreach (string cmd in commands) {
- cli.send(cmd);
+ try {
+ cli.send(cmd);
+ } catch (Error e) {
+ stderr.printf("Error sending command: %s", e.message);
+ }
}
// wait a minimal amount of time, to ensure the event was sent
@@ -62,4 +66,4 @@ void on_bus_aquired(DBusConnection con) {
stderr.printf("Could not register service\n");
}
-} \ No newline at end of file
+}