bugfix: create a message for 403 errors

When handling a BrowserForbidden error, the msg variable was not initialized,
thus leading to a reference before assignement error.
This commit is contained in:
Johann Dreo 2015-09-27 20:34:59 +02:00
commit b8389a9112

View file

@ -569,6 +569,9 @@ class ConsoleApplication(Application):
elif isinstance(error, BrowserSSLError):
print(u'FATAL(%s): ' % backend.name + self.BOLD + '/!\ SERVER CERTIFICATE IS INVALID /!\\' + self.NC, file=self.stderr)
elif isinstance(error, BrowserForbidden):
msg = unicode(error)
if not msg:
msg = 'access denied'
print(u'Error(%s): %s' % (backend.name, msg or 'Forbidden'), file=self.stderr)
elif isinstance(error, BrowserUnavailable):
msg = unicode(error)