Source code for tcs_lib.errors

# Library with high level interface to HET's TCS
# Copyright (C) 2017, 2018 "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 with the Exception definitions used in :mod:`tcs_lib`'''
from __future__ import (absolute_import, division, print_function,
                        unicode_literals)


[docs]class TCSLibError(Exception): '''Error used as base class for all the others''' pass
[docs]class DBOrderingError(TCSLibError, ValueError): '''The database ordering keyword is not correct''' pass
[docs]class ConvertTypeError(TCSLibError, TypeError): '''Raised when the type to encode/decode is not correct''' pass
[docs]class TCSEventIndexError(TCSLibError, IndexError): '''Raise when an incoming TCS event is not composes of two parts''' pass
[docs]class TCSJSONDecodeError(TCSLibError, ValueError): '''Raise when the second part of the TCS event is not a valid json''' pass