Isolate util/executable

This commit is contained in:
Douglas Jacobsen 2023-10-12 14:54:43 -06:00
parent 3a6ad72ac1
commit 30cafc553a
2 changed files with 14 additions and 3 deletions

View File

@ -0,0 +1,8 @@
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class UtilityError(Exception):
"""Base error for all errors from the utility package"""

View File

@ -11,7 +11,7 @@
import llnl.util.tty as tty
import spack.error
import spack.util.error
__all__ = ["Executable", "which", "ProcessError"]
@ -362,7 +362,10 @@ def which(*args, **kwargs):
return Executable(exe) if exe else None
class ProcessError(spack.error.SpackError):
class EditorError(spack.util.error.UtilityError):
"""Base error for all errors from the executable utility"""
class ProcessError(EditorError):
"""ProcessErrors are raised when Executables exit with an error code."""
@ -371,5 +374,5 @@ class ProcessTimeoutError(ProcessError):
specified timeout exceed that time"""
class CommandNotFoundError(spack.error.SpackError):
class CommandNotFoundError(EditorError):
"""Raised when ``which()`` can't find a required executable."""