Skip to content
Snippets Groups Projects
Commit 8ab47537 authored by Todd Gamblin's avatar Todd Gamblin Committed by GitHub
Browse files

Fix exception constructors. (#1663)

parent cf11c327
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
from yaml.error import MarkedYAMLError from yaml.error import MarkedYAMLError
import spack import spack
import spack.error
class ProviderIndex(object): class ProviderIndex(object):
...@@ -201,11 +202,10 @@ def from_yaml(stream): ...@@ -201,11 +202,10 @@ def from_yaml(stream):
"error parsing YAML ProviderIndex cache:", str(e)) "error parsing YAML ProviderIndex cache:", str(e))
if not isinstance(yfile, dict): if not isinstance(yfile, dict):
raise spack.spec.SpackYAMLError( raise ProviderIndexError("YAML ProviderIndex was not a dict.")
"YAML ProviderIndex was not a dict.")
if 'provider_index' not in yfile: if 'provider_index' not in yfile:
raise spack.spec.SpackYAMLError( raise ProviderIndexError(
"YAML ProviderIndex does not start with 'provider_index'") "YAML ProviderIndex does not start with 'provider_index'")
index = ProviderIndex() index = ProviderIndex()
...@@ -291,3 +291,7 @@ def mapiter(mappings): ...@@ -291,3 +291,7 @@ def mapiter(mappings):
(name, out_mapping_type([ (name, out_mapping_type([
transform_fun(vpkg, pset) for vpkg, pset in mapiter(mappings)])) transform_fun(vpkg, pset) for vpkg, pset in mapiter(mappings)]))
for name, mappings in providers.items()) for name, mappings in providers.items())
class ProviderIndexError(spack.error.SpackError):
"""Raised when there is a problem with a ProviderIndex."""
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment