~ganiserb/encuentro/metadata-autoupdate

« back to all changes in this revision

Viewing changes to encuentro/ui/main.py

  • Committer: Facundo Batista
  • Date: 2013-11-19 03:09:20 UTC
  • Revision ID: facundo@taniquetil.com.ar-20131119030920-wlif7wws8o00tt9n
Better exception handling and showing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
401
401
                self.episodes_download.end(error=msg)
402
402
            except EncuentroError, e:
403
403
                orig_exc = e.orig_exc
404
 
                msg = str(orig_exc)
 
404
                msg = "%s(%s)" % (orig_exc, e)
405
405
                err_type = e.__class__.__name__
406
 
                logger.debug("Custom Encuentro error: %s (%r)", e, orig_exc)
 
406
                logger.exception("Custom Encuentro error: %s (%r)",
 
407
                                 e, orig_exc)
407
408
                # check if it's an error from mechanize and continue working if
408
409
                # yes, as it's a normal 500 most of the times; this can not
409
410
                # be easily checked as the exception itself is dynamically
415
416
                    self.show_message(err_type, msg)
416
417
                self.episodes_download.end(error=u"Error: " + msg)
417
418
            except Exception, e:
418
 
                logger.debug("Unknown download error: %s (%r)", e, e)
 
419
                logger.exception("Unknown download error: %s (%r)", e, e)
419
420
                err_type = e.__class__.__name__
420
421
                self.show_message(err_type, str(e))
421
422
                self.episodes_download.end(error=u"Error: " + str(e))