mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 17:23:36 +02:00
cmds.distro.CmdInfo: Beautify exception logging
CmdInfo._expand_macros() raises a custom exception during exception handling. Replace that by logging some details and raising the original exception to keep the stack trace readable. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
ca6f27d2f0
commit
666f778e05
1 changed files with 3 additions and 1 deletions
|
|
@ -3,6 +3,7 @@
|
|||
import re
|
||||
from argparse import Namespace, ArgumentParser
|
||||
|
||||
from ...lib.log import *
|
||||
from ..Cmd import Cmd
|
||||
from ..CmdProjects import CmdProjects
|
||||
|
||||
|
|
@ -22,7 +23,8 @@ class CmdInfo(Cmd): # export
|
|||
continue
|
||||
ret = ret.replace(patt, val)
|
||||
except Exception as e:
|
||||
raise Exception(f'Failed to expand macro "{macro}" inside "{string}": {e}')
|
||||
log(ERR, f'Failed to expand macro "{macro}" inside "{string}": {str(e)}')
|
||||
raise
|
||||
return ret
|
||||
|
||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue