mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
more info on yaml errors
print yaml's 'problem'
This commit is contained in:
@@ -31,7 +31,7 @@ __all__ = [
|
|||||||
|
|
||||||
YAML_SYNTAX_ERROR = """\
|
YAML_SYNTAX_ERROR = """\
|
||||||
Syntax Error while loading YAML.
|
Syntax Error while loading YAML.
|
||||||
"""
|
%s"""
|
||||||
|
|
||||||
YAML_POSITION_DETAILS = """\
|
YAML_POSITION_DETAILS = """\
|
||||||
The error appears to have been in '%s': line %s, column %s, but may
|
The error appears to have been in '%s': line %s, column %s, but may
|
||||||
|
|||||||
@@ -225,7 +225,9 @@ class DataLoader:
|
|||||||
err_obj = AnsibleBaseYAMLObject()
|
err_obj = AnsibleBaseYAMLObject()
|
||||||
err_obj.ansible_pos = (file_name, yaml_exc.problem_mark.line + 1, yaml_exc.problem_mark.column + 1)
|
err_obj.ansible_pos = (file_name, yaml_exc.problem_mark.line + 1, yaml_exc.problem_mark.column + 1)
|
||||||
|
|
||||||
raise AnsibleParserError(YAML_SYNTAX_ERROR, obj=err_obj, show_content=show_content, orig_exc=yaml_exc)
|
err_msg = getattr(yaml_exc, 'problem', '')
|
||||||
|
|
||||||
|
raise AnsibleParserError(YAML_SYNTAX_ERROR % to_native(err_msg), obj=err_obj, show_content=show_content, orig_exc=yaml_exc)
|
||||||
|
|
||||||
def get_basedir(self):
|
def get_basedir(self):
|
||||||
''' returns the current basedir '''
|
''' returns the current basedir '''
|
||||||
|
|||||||
Reference in New Issue
Block a user