lago
lago copied to clipboard
Make 'PrefixAlreadyExists' exception nicer
-
PrefixAlreadyExists
should extendLagoUserException
so the stack trace will not be
dumped to stdout, -
We should add to the exception's message an explenation about how to solve the problem.
(lago_venv)~/t2/exported/e$lago init
@ Initialize and populate prefix:
@ Initialize and populate prefix: ERROR (in 0:00:00)
Error occured, aborting
Traceback (most recent call last):
File "/home/gbenhaim/lago/lago/cmd.py", line 949, in main
cli_plugins[args.verb].do_run(args)
File "/home/gbenhaim/lago/lago/plugins/cli.py", line 184, in do_run
self._do_run(**vars(args))
File "/home/gbenhaim/lago/lago/cmd.py", line 163, in do_init
prefix = workdir.add_prefix(prefix_name)
File "/home/gbenhaim/lago/lago/workdir.py", line 72, in decorator
return func(workdir, *args, **kwargs)
File "/home/gbenhaim/lago/lago/workdir.py", line 275, in add_prefix
(name, self.path)
PrefixAlreadyExists: Prefix with name default already exists in workdir /home/gbenhaim/t2/exported/e/.lago