""" Exceptions throwable by the Sampling algorithm $Id: test.py 803 2008-12-03 12:08:26Z goodwin $ """ # 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: goodwin $" __version__ = "$Revision: 803 $" __updated__ = "$LastChangedDate$" class SamplingError(Exception): """Basic class for reporting SamplingError """ class NoSiteInformationError(SamplingError): """Exception when there is no information from a site """ def __init__(self, sitename): """ Throws a NoSiteInformationError exception Keyword arguments: sitename -- Name of the instance """ msg = 'There is no information about site %s. Problably the WAMs are not responding.' %(str(sitename)) SamplingError.__init__(self,msg) class NoSamplingChosenError(SamplingError): """Exception raised when no sampling algorithm is chosen """ def __init__(self): """ Throws a InstanceNotPresentError exception """ msg = 'No sampling algorithm chosen. Update your system configuration.' SamplingError.__init__(self,msg)