util.sasl_cyrus: Return error strings using the new table mapping error codes to strings.
authorWaqas Hussain <waqas20@gmail.com>
Thu, 24 Jun 2010 04:16:09 +0500
changeset 3299 4448789c19ca
parent 3298 94087ee7587b
child 3300 b651f8290e27
util.sasl_cyrus: Return error strings using the new table mapping error codes to strings.
util/sasl_cyrus.lua
--- a/util/sasl_cyrus.lua	Thu Jun 24 04:13:01 2010 +0500
+++ b/util/sasl_cyrus.lua	Thu Jun 24 04:16:09 2010 +0500
@@ -166,10 +166,10 @@
 	   log("debug", "SASL mechanism not available from remote end")
 	   return "failure", "invalid-mechanism", "SASL mechanism not available"
 	elseif (err == -13) then -- SASL_BADAUTH
-	   return "failure", "not-authorized", cyrussasl.get_message( self.cyrus )
+	   return "failure", "not-authorized", sasl_errstring[err];
 	else
-	   log("debug", "Got SASL error condition %d: %s", err, cyrussasl.get_message( self.cyrus ))
-	   return "failure", "undefined-condition", cyrussasl.get_message( self.cyrus )
+	   log("debug", "Got SASL error condition %d: %s", err, sasl_errstring[err]);
+	   return "failure", "undefined-condition", sasl_errstring[err];
 	end
 end