Commits

Roger Light committed 7e36778

Re-raise unhandled errors in Python so as not to provide confusing error
messages later on.

Thanks to Jack O'Connor.

  • Participants
  • Parent commits a46070e
  • Branches 1.2

Comments (0)

Files changed (2)

 
 Client library:
 - Fix building on Android NDK.
+- Re-raise unhandled errors in Python so as not to provide confusing error
+  messages later on.
 
 1.1 - 20121219
 ==============

lib/python/mosquitto.py

         except socket.error as err:
             (msg) = err
             if msg.errno != errno.EINPROGRESS:
-                print(msg)
-                return 1
+                raise
 
         self._sock.setblocking(0)
 
                     return MOSQ_ERR_AGAIN
                 if msg.errno == errno.EAGAIN:
                     return MOSQ_ERR_AGAIN
-                print(msg)
-                return 1
+                raise
             else:
                 if len(command) == 0:
                     return 1
                         return MOSQ_ERR_AGAIN
                     if msg.errno == errno.EAGAIN:
                         return MOSQ_ERR_AGAIN
-                    print(msg)
-                    return 1
+                    raise
                 else:
                     byte = struct.unpack("!B", byte)
                     byte = byte[0]
                     return MOSQ_ERR_AGAIN
                 if msg.errno == errno.EAGAIN:
                     return MOSQ_ERR_AGAIN
-                print(msg)
-                return 1
+                raise
             else:
                 self._in_packet.to_process = self._in_packet.to_process - len(data)
                 self._in_packet.packet = self._in_packet.packet + data
                     return MOSQ_ERR_AGAIN
                 if msg.errno == errno.EAGAIN:
                     return MOSQ_ERR_AGAIN
-                print(msg)
-                return 1
+                raise
 
             if write_length > 0:
                 packet.to_process = packet.to_process - write_length