Permalink
Browse files

TRIVIAL: Improve error reporting

When error occurs in !included yaml, we'd like to know the
name of file where error actually occurred instead of
just top-level yaml file name.
Also we want to know the reason why the error happened.
  • Loading branch information...
mouchar committed Mar 16, 2018
1 parent d8e5774 commit 806f28e973938f604f82fdc58663dec0da2e50ba
Showing with 5 additions and 3 deletions.
  1. +1 −1 setup.py
  2. +1 −1 sgmanager.spec
  3. +3 −1 sgmanager/securitygroups/__init__.py
@@ -6,7 +6,7 @@
setup(
name='sgmanager',
version='1.4.8',
version='1.4.9',
packages=['sgmanager', 'sgmanager.logger', 'sgmanager.securitygroups'],
entry_points={
'console_scripts': ['sgmanager = sgmanager.cli:main']
@@ -1,7 +1,7 @@
%global with_check 0
Name: sgmanager
Version: 1.4.8
Version: 1.4.9
Release: 1%{?dist}
Summary: Tooling for EC2 security groups management
@@ -135,7 +135,9 @@ def load_local_groups(self, config, mode):
# Error while parsing YAML
if hasattr(e, 'problem_mark'):
mark = e.problem_mark
raise InvalidConfiguration("Can't parse config file %s: error at line %s, column %s" % (config, mark.line+1, mark.column+1))
raise InvalidConfiguration(
"Can't parse config file %s: %s at line %s, column %s" % (
mark.name, e.problem, mark.line + 1, mark.column + 1))
else:
raise InvalidConfiguration("Can't parse config file %s: %s" % (config, e))
# Empty config file is considered invalid

0 comments on commit 806f28e

Please sign in to comment.