diff options
author | Anton Khirnov <wyskas@gmail.com> | 2009-09-04 14:39:08 +0200 |
---|---|---|
committer | Anton Khirnov <wyskas@gmail.com> | 2009-09-04 14:39:08 +0200 |
commit | c632ef7e3a89add73854aef0ae72d7b0d2d4b16c (patch) | |
tree | 14cb83704b5575eb7564306e86d73a735d81d392 /nephilim/common.py | |
parent | 3cad6f70f5111db38e0b392a2f1a270ec927dd03 (diff) |
Lyrics: decrease priority of an error message.
also add error handling.
Diffstat (limited to 'nephilim/common.py')
-rw-r--r-- | nephilim/common.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/nephilim/common.py b/nephilim/common.py index 2663fa6..a04cc42 100644 --- a/nephilim/common.py +++ b/nephilim/common.py @@ -114,6 +114,7 @@ class MetadataFetcher(QtCore.QObject): self.logger.info('Searching %s: %s.'%(self. name, url)) self.rep = self.nam.get(QtNetwork.QNetworkRequest(url)) + self.rep.error.connect(self.handle_error) def finish(self, metadata = None): """A private convenience function to clean up and emit finished(). @@ -123,6 +124,11 @@ class MetadataFetcher(QtCore.QObject): self.finished.emit(self.song, metadata) self.song = None + def handle_error(self): + """Print the error and abort.""" + self.logger.error(self.rep.errorString()) + self.abort() + #### public #### def fetch(self, song): """Reimplement this in subclasses.""" |