Source code for libvhc.exceptions
# Virus Health Check: a validation tool 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/>.
"""Module containing the definitions off all the VHC custom exceptions"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
[docs]class VHCError(Exception):
"""Base exception for VHC: all vhc specific errors should be derived from
this one"""
pass
[docs]class VHCPathError(VHCError):
'''Raised if the path provided to vhc is not a valid shot'''
pass
[docs]class VHCRecipeError(VHCError):
"""Something when retrieving a recipe from the file names"""
[docs]class VHCValueError(VHCError, ValueError):
"""Format error in the module-function names"""
pass
[docs]class VHCTypeError(VHCError, TypeError):
"""Format error in the module-function names"""
pass
[docs]class VHCFactoryKeyError(VHCError, KeyError):
"""Errors when formatting the command in the vhc factories"""
pass
[docs]class VHCReferenceKeyError(VHCError, KeyError):
"""Error raised when the reference file parser fails to get a value"""
pass
[docs]class VHCLoaderError(VHCError):
"""Base class for errors raised in the :mod:`libvhc.loaders` module"""
[docs]class VHCAttributeError(VHCLoaderError, AttributeError):
"""VHC specific attribute error exception"""
pass
[docs]class VHCImportError(VHCLoaderError, ImportError):
"""VHC specific import error exception"""
pass
[docs]class VHCQueueError(Exception):
"""Custom errors related with the queues used for communication"""
pass
[docs]class VHCQueueItemError(VHCQueueError, TypeError):
"""The type of object inserted in the queue is wrong"""
pass