lago icon indicating copy to clipboard operation
lago copied to clipboard

Make 'PrefixAlreadyExists' exception nicer

Open gbenhaim opened this issue 7 years ago • 0 comments

  1. PrefixAlreadyExists should extend LagoUserException so the stack trace will not be
    dumped to stdout,

  2. 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

gbenhaim avatar Jun 28 '17 08:06 gbenhaim