Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message logging on exit #592

Merged
merged 14 commits into from
Jun 29, 2016
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 1 addition & 4 deletions snapcraft/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@
import shutil
import sys
import subprocess
import textwrap

from docopt import docopt

Expand Down Expand Up @@ -209,9 +208,7 @@ def main(argv=None):
except Exception as e:
if args['--debug']:
raise

logger.error(textwrap.fill(str(e)))
sys.exit(1)
sys.exit(e)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bad merge. I changed these lines after you made your branch.
The correct merged statements would be:
logger.error(str(e))
sys.exit(1)



def _get_lifecycle_command(args):
Expand Down
8 changes: 4 additions & 4 deletions snapcraft/tests/test_commands_cleanbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def test_no_lxd(self, mock_installed):
self.assertEqual(
fake_logger.output,
'The lxd package is not installed, in order to use `cleanbuild` '
'you\nmust install lxd onto your system. Refer to the '
'"Ubuntu Desktop and\nUbuntu Server" section on '
'https://linuxcontainers.org/lxd/getting-\nstarted-cli/'
'#ubuntu-desktop-and-ubuntu-server to enable a proper\nsetup.\n')
'you must install lxd onto your system. Refer to the '
'"Ubuntu Desktop and Ubuntu Server" section on '
'https://linuxcontainers.org/lxd/getting-started-cli/'
'#ubuntu-desktop-and-ubuntu-server to enable a proper setup.')