mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-26 18:50:32 +00:00
Improve exception handling by using unicode.
This commit is contained in:
parent
f46889a4af
commit
0941f6ff02
1 changed files with 3 additions and 3 deletions
|
|
@ -583,10 +583,10 @@ class UrlBase (object):
|
|||
not value:
|
||||
# EBADF occurs when operating on an already socket
|
||||
self.caching = False
|
||||
errmsg = etype.__name__
|
||||
if str(value):
|
||||
errmsg = unicode(etype.__name__)
|
||||
if unicode(value):
|
||||
# use Exception class name
|
||||
errmsg += ": %s" % str(value)
|
||||
errmsg += u": %s" % unicode(value)
|
||||
# limit length to 240
|
||||
return strformat.limit(errmsg, length=240)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue