wakaru44 / capitulizer

un frontend para ver tv en internet
1 stars 0 forks source link

Error parseando mensaje recibido. - Mensaje vacio #1

Closed wakaru44 closed 11 years ago

wakaru44 commented 11 years ago

Sending a mail to the app, if the html message is broken, extractSY.linksToEpisodes gives an exception.

'NoneType' object has no attribute 'replace' Traceback (most recent call last): File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.5.1/webapp2.py", line 1536, in call rv = self.handle_exception(request, response, e) File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.5.1/webapp2.py", line 1530, in call rv = self.router.dispatch(request, response) File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.5.1/webapp2.py", line 1278, in default_dispatcher return route.handler_adapter(request, response) File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.5.1/webapp2.py", line 1102, in call return handler.dispatch() File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.5.1/webapp2.py", line 572, in dispatch return self.handle_exception(e, self.app.debug) File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.5.1/webapp2.py", line 570, in dispatch return method(_args, *_kwargs) File "/base/python27_runtime/python27_lib/versions/1/google/appengine/ext/webapp/mail_handlers.py", line 65, in post self.receive(mail.InboundEmailMessage(self.request.body)) File "/base/data/home/apps/s~capitulizer/1.363265656426203682/email_aggregateEpisodes.py", line 32, in receive self.getBody(mail_message)) # Links list File "/base/data/home/apps/s~capitulizer/1.363265656426203682/extractSY.py", line 115, in linksToEpisodes syMsg = msg.replace("=\n", "")

wakaru44 commented 11 years ago

We could avoid this checking if we had received an actual message (string). If not, send a copy of the sent thing to the admin. (raising a custom exception)

wakaru44 commented 11 years ago

improved with the refactoring made with adolfo.pa