13 lines
168 B
Python
13 lines
168 B
Python
|
|
def printable_exception(exc):
|
|
tn = typename(exc)
|
|
msg = str(exc)
|
|
return f"{tn}: {msg}" if msg else tn
|
|
|
|
|
|
def typename(obj):
|
|
return type(obj).__name__
|
|
|
|
|
|
|