Source code for spack.modules.error
# Copyright Spack Project Developers. See COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""Errors and exceptions for the modules package."""
import spack.error
[docs]
class ModulesError(spack.error.SpackError):
"""Base error for modules."""
[docs]
class ModuleNotFoundError(ModulesError):
"""Raised when a module cannot be found for a spec"""
[docs]
class DefaultTemplateNotDefined(AttributeError, ModulesError):
"""Raised if ``default_template`` has not been specified in the derived class."""
[docs]
class ModulesTemplateNotFoundError(ModulesError, RuntimeError):
"""Raised if the template for a module file was not found."""
[docs]
class CoreCompilersNotFoundError(spack.error.SpackError, KeyError):
"""Raised if ``core_compilers`` has not been specified in the configuration file."""