clix.roster: Print error resplies

Mon, 21 Mar 2016 16:06:14 +0100

author
Kim Alvefur <zash@zash.se>
date
Mon, 21 Mar 2016 16:06:14 +0100
changeset 123
c61fadb9d4fa
parent 122
1dfd28db10bd
child 124
ff422623e0ba

clix.roster: Print error resplies

clix/roster.lua file | annotate | diff | comparison | revisions
--- a/clix/roster.lua	Mon Sep 08 12:20:24 2014 +0200
+++ b/clix/roster.lua	Mon Mar 21 16:06:14 2016 +0100
@@ -1,6 +1,14 @@
 short_opts.i = "interactive";
 local split_jid = require "util.jid".split;
-local function printor(str) return function() print(str) end end
+local function printor(str)
+	return function(ok, err)
+		if ok then
+			print(str)
+		else
+			print(err:get_error());
+		end
+	end
+end
 
 return function (opts, arg)
 	if opts.short_help then

mercurial