Source code for rios.rioserrors

#!/usr/bin/env python
"""
All exceptions used within rios. 

"""
# This file is part of RIOS - Raster I/O Simplification
# Copyright (C) 2012  Sam Gillingham, Neil Flood
#
# 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 <http://www.gnu.org/licenses/>.


[docs]class RiosError(Exception): """ Base class for RIOS exceptions """
[docs]class FileOpenError(RiosError): "Failed to open an input or output file"
[docs]class ImageOpenError(FileOpenError): "Image wasn't able to be opened by GDAL"
[docs]class ParameterError(RiosError): "Incorrect parameters passed to function"
[docs]class GDALLayerNumberError(RiosError): "A GDAL layer number was given, but was out of range"
[docs]class ResampleNeededError(RiosError): "Images do not match - resample needs to be turned on"
[docs]class OutsideImageBoundsError(RiosError): "Requested Block is not available"
[docs]class GdalWarpError(RiosError): "Error while running gdalwarp"
[docs]class ThematicError(RiosError): "File unable to be set to thematic"
[docs]class ProcessCancelledError(RiosError): "Process was cancelled by user"
[docs]class KeysMismatch(RiosError): "Keys do not match expected"
[docs]class MismatchedListLengthsError(RiosError): "Two lists had different lengths, when they were supposed to be the same length"
[docs]class AttributeTableColumnError(RiosError): "Unable to find specified column"
[docs]class AttributeTableTypeError(RiosError): "Type does not match that expected"
[docs]class ArrayShapeError(RiosError): "Error in shape of an array"
[docs]class TypeConversionError(RiosError): "Unknown type conversion"
[docs]class VectorAttributeError(RiosError): "Unable to find specified index in vector file"
[docs]class VectorGeometryTypeError(RiosError): "Unexpected Geometry type"
[docs]class VectorProjectionError(RiosError): "Vector projection does not match raster projection"
[docs]class VectorRasterizationError(RiosError): "Rasterisation of Vector dataset failed"
[docs]class VectorLayerError(RiosError): "Unable to find the specified layer"
[docs]class WrongControlsObject(RiosError): "The wrong type of control object has been passed to apply"
[docs]class RatBlockLengthError(RiosError): "Error with RAT block length, in ratapplier"
[docs]class RatMismatchError(RiosError): "Inconsistent RATs on inputs to ratapplier"
[docs]class IntersectionError(RiosError): "Images don't have a common area"
[docs]class JobMgrError(RiosError): "Errors from Jobmanager class"
[docs]class ColorTableGenerationError(RiosError): "Error generating a color table"
[docs]class PermissionError(RiosError): "Error due to permissions on temp files"