"""Errors raisable for the System Configuration""" # Copyright 2008-2011 eGovMon # This program is distributed under the terms of the GNU General # Public License. # # This file is part of the eGovernment Monitoring # (eGovMon) # # eGovMon 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 2 of the License, or # (at your option) any later version. # # eGovMon 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 eGovMon; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, # MA 02110-1301 USA __author__ = "$Author$" __version__ = "$Revision$" __updated__ = "$LastChangedDate$" class SystemConfigurationError(Exception): """Basic class for reporting System Configuration errors """ class NotEnoughInformationError(SystemConfigurationError): """Exception when System Configuration does not have enough information """ def __init__(self,variablelist): """Throws an NotEnoughInformationError exception. Keyword argumnts: varianblelist -- The list of variables not set """ msg = 'Not enough information. More variables must be set: ' SystemConfigurationError.__init__(self,msg + ' '.join(variablelist)) class NoRDFModelPresentError(SystemConfigurationError): """Exception when the RDF model is not present """ def __init__(self): """Throws an NoModelPresentError exception. """ msg = 'No RDF model found' SystemConfigurationError.__init__(self,msg) class InitialRDFNotFoundError(SystemConfigurationError): """Exception when the initial RDF is not found """ def __init__(self,filenames): """Throws an InitialRDFNotFoundError exception. Keyword argumnts: filenames -- Filenames not found """ msg = 'Initial RDF not found: (' + ','.join(filenames) + ')' SystemConfigurationError.__init__(self,msg) class InvalidURLError(SystemConfigurationError): """Exception when a URL is invalid """ def __init__(self,url): """Throws an InvalidURLError exception. Keyword argumnts: url -- The invalid URL """ msg = 'The URL is invalid: ' + str(url) SystemConfigurationError.__init__(self,msg)