summaryrefslogtreecommitdiffstats
path: root/src/cli
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli')
-rw-r--r--src/cli/cli.vala2
-rw-r--r--src/cli/main.vala8
2 files changed, 7 insertions, 3 deletions
diff --git a/src/cli/cli.vala b/src/cli/cli.vala
index bc6fe9d..c0ba61e 100644
--- a/src/cli/cli.vala
+++ b/src/cli/cli.vala
@@ -21,7 +21,7 @@ public class CliImpl {
public CliImpl() {
}
- public void send(string msg) {
+ public void send(string msg) throws IOError, DBusError {
stdout.printf("Sending: %s\n", msg);
received_barcode(msg);
}
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
+}