diff --git a/copyparty/util.py b/copyparty/util.py index 8b6b2b7c..649edf08 100644 --- a/copyparty/util.py +++ b/copyparty/util.py @@ -284,13 +284,11 @@ def alltrace(): def min_ex(): et, ev, tb = sys.exc_info() - tb = traceback.extract_tb(tb, 2) - ex = [ - "{} @ {} <{}>: {}".format(fp.split(os.sep)[-1], ln, fun, txt) - for fp, ln, fun, txt in tb - ] - ex.append("{}: {}".format(et.__name__, ev)) - return "\n".join(ex) + tb = traceback.extract_tb(tb) + fmt = "{} @ {} <{}>: {}" + ex = [fmt.format(fp.split(os.sep)[-1], ln, fun, txt) for fp, ln, fun, txt in tb] + ex.append("[{}] {}".format(et.__name__, ev)) + return "\n".join(ex[-8:]) @contextlib.contextmanager