From 98901bb75eda0e7a79da413014a9e43cbc317a5e Mon Sep 17 00:00:00 2001 From: Milka Kuzminski Date: Mon, 21 Dec 2020 17:17:24 +0100 Subject: [PATCH] exc: fixed exceptions prefix (again) --- rhodecode/lib/vcs/exceptions.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rhodecode/lib/vcs/exceptions.py b/rhodecode/lib/vcs/exceptions.py index 237a0320..47e0fcbe 100644 --- a/rhodecode/lib/vcs/exceptions.py +++ b/rhodecode/lib/vcs/exceptions.py @@ -218,8 +218,9 @@ def map_vcs_exceptions(func): if kind: if any(e.args): - args = [a for a in e.args] - args.insert(0, '{}:'.format(exc_name)) # prefix first arg with org exc name + _args = [a for a in e.args] + # replace the first argument with a prefix exc name + args = ['{}:'.format(exc_name, _args[0] if _args else '?')] + _args[1:] else: args = [__traceback_info__ or '{}: UnhandledException'.format(exc_name)] if debug or __traceback_info__ and kind not in ['unhandled', 'lookup']: