Source code for vdat.command_interpreter.exceptions
# Virus Data Analysis Tool: a data reduction GUI for HETDEX/VIRUS data
# Copyright (C) 2015, 2016 "The HETDEX collaboration"
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
"""Command interpreter exceptions"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
[docs]class CIError(Exception):
"""Generic exception. It's the parent of all the other exceptions defined
here"""
pass
[docs]class CIValidationError(CIError):
"""Exception raised when validating the command in the constructor"""
pass
[docs]class CINoExeError(CIValidationError):
"""Raised when the executable ``name`` is not found"""
def __init__(self, name):
msg = "The executable '{}' has not been found in the system path"
super(CINoExeError, self).__init__(msg.format(name))
[docs]class CIParseError(CIValidationError):
"""Failed parsing of the command"""
pass
[docs]class CIKeywordValidationError(CIValidationError):
"""Raised when the keyword validation fails"""
pass
[docs]class CIKeywordTypeError(CIKeywordValidationError):
"""Raised when the keyword doesn't have a ``type`` key or its type is not
known"""
pass
[docs]class CIRunError(CIError):
"""Raised when running the command"""
pass
[docs]class CIPrimaryError(CIRunError):
"""Raised if something bad happens when handling a primary keyword"""
pass
[docs]class CIKeywordError(CIRunError):
"""Raised if something bad happens when handling a secondary keyword"""
pass
[docs]class CICommandFmtError(CIRunError):
"""Raised when the replacement of the keyword fails"""
pass
[docs]class CISubprocessError(CIRunError):
"""Error raised when the start of the subprocess or the communication with
it fails. It's not related with the execution of the underlying command"""
pass
[docs]class CISliceError(CIError, ValueError):
"""Errors raised while initialising the command_interpreter.utils.SliceLike
class"""
pass