diff options
author | Tom Pollard <tom.pollard@codethink.co.uk> | 2019-07-17 15:48:06 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-07-18 11:36:07 +0000 |
commit | e7524c4340523d06ba3d6d95cb1e284b0f4b415e (patch) | |
tree | 271d658e2fcdb7917dfca3c1270a4c3f31e80d76 /src/buildstream/_includes.py | |
parent | d79747d7ee2596a73f4ec68bd40bd2ca04427a93 (diff) | |
download | buildstream-e7524c4340523d06ba3d6d95cb1e284b0f4b415e.tar.gz |
_exceptions.py: Align LoadError() parameter orderingtpollard/loaderror
All of the errors which subclass from BstError have their first
positional argument as message, LoadError should follow this
ordering for consistency.
Diffstat (limited to 'src/buildstream/_includes.py')
-rw-r--r-- | src/buildstream/_includes.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/buildstream/_includes.py b/src/buildstream/_includes.py index 75d748723..0ba40e63d 100644 --- a/src/buildstream/_includes.py +++ b/src/buildstream/_includes.py @@ -57,19 +57,18 @@ class Includes: if e.reason == LoadErrorReason.MISSING_FILE: message = "{}: Include block references a file that could not be found: '{}'.".format( include_provenance, include) - raise LoadError(LoadErrorReason.MISSING_FILE, message) from e + raise LoadError(message, LoadErrorReason.MISSING_FILE) from e elif e.reason == LoadErrorReason.LOADING_DIRECTORY: message = "{}: Include block references a directory instead of a file: '{}'.".format( include_provenance, include) - raise LoadError(LoadErrorReason.LOADING_DIRECTORY, message) from e + raise LoadError(message, LoadErrorReason.LOADING_DIRECTORY) from e else: raise if file_path in included: include_provenance = includes_node.get_provenance() - raise LoadError(LoadErrorReason.RECURSIVE_INCLUDE, - "{}: trying to recursively include {}". format(include_provenance, - file_path)) + raise LoadError("{}: trying to recursively include {}". format(include_provenance, file_path), + LoadErrorReason.RECURSIVE_INCLUDE) # Because the included node will be modified, we need # to copy it so that we do not modify the toplevel # node of the provenance. |