Commits

Matt Joiner committed ccf914b

Improve tracker announce exception messages.

  • Participants
  • Parent commits 11ea397

Comments (0)

Files changed (1)

         try:
             response = urllib.request.urlopen(url, timeout=timeout)
         except Exception as exc:
-            raise AnnounceError() from exc
+            raise AnnounceError(exc) from exc
         self.logger.debug('%s: Response from %s:\n%s', self, response.geturl(), response.info())
         try:
             response_body = bencoding.buncode(response).__next__()
             try:
                 data = self.socket.recv(4096)
             except (socket.timeout, socket.error) as exc:
-                raise AnnounceError(exc)
+                raise AnnounceError from exc
             response_action, transaction_id = struct.unpack_from('>II', data)
             if transaction_id != self.transaction_id:
                 self.logger.warning("%s: Transaction ID doesn't match: %08x", self, transaction_id)