Skip to content

Commit

Permalink
Log a message when a QtNetworkReply errors out
Browse files Browse the repository at this point in the history
  • Loading branch information
EvaSDK committed Jan 6, 2017
1 parent ef329f1 commit 3dfa605
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ghost/ghost.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,19 @@ def createRequest(self, operation, request, data):
reply.downloadProgress.connect(
partial(reply_download_progress, reply)
)
reply.error.connect(partial(self._reply_error_callback, reply))

self.logger.debug('Registring reply for %s', reply.url().toString())
self._registry[id(reply)] = reply

time.sleep(0.001)
return reply

def _reply_error_callback(self, reply, error_code):
"""Log an error message on QtNetworkReply error."""
self.logger.debug('Reply for %s encountered an error: %s',
reply.url().toString(), reply.errorString())

def _reply_finished_callback(self, reply):
"""Unregister a complete QNetworkReply."""
self.logger.debug('Reply for %s complete', reply.url().toString())
Expand Down

0 comments on commit 3dfa605

Please sign in to comment.