Commits

Blue committed 1f45ec2

Small bugfix in parsing, and made the error message when connecting to the nntp server more informational.

Comments (0)

Files changed (2)

spotnet/management/commands/update_spotnet.py

         conn = Connection(connect=False)
         try:
             conn.connect()
-        except ConnectError:
-            raise CommandError('Could not connect to the newsserver.')
+        except ConnectError as e:
+            raise CommandError('Could not connect to the newsserver, error was: %s' % e)
         else:
             conn.update(self.logger_function)
         finally:
             if line.startswith('Lines: '):
                 l = num
                 break
-        if l == 0:
+        if l == -1:
             raise InvalidPost("Post does not have a Lines header.")
         body_lines = int(content[l][len('Lines: '):])
         last_header = None