<filename>gensrc/gensrc/utilities/exceptions.py

"""
 Copyright (C) 2008 <NAME>

 This file is part of QuantLib, a free-software/open-source library
 for financial quantitative analysts and developers - http://quantlib.org/

 QuantLib is free software: you can redistribute it and/or modify it
 under the terms of the QuantLib license.  You should have received a
 copy of the license along with this program; if not, please email
 <<EMAIL>>. The license is also available online at
 <http://quantlib.org/license.shtml>.

 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 license for more details.
"""

"""Exceptions encountered when performing utility functions."""

from gensrc.exceptions import exceptions
import sys

class UtilitiesException(exceptions.GensrcException):
    """Exceptions encountered when performing utility functions."""

class UtilitiesSerializationException(UtilitiesException):
    """Error serializing an object from XML."""

    SERIALIZATION_ERROR = """
Error loading object of class '%(className)s' from XML document '%(fileName)s.xml' :
%(parseError)s"""

    def __init__(self, fileName, className):
        """Initialize the UtilitiesSerializationException object."""
        errorClass, errorObject, traceBack = sys.exc_info()
        self.value_ = UtilitiesSerializationException.SERIALIZATION_ERROR % {
            'className' : className,
            'fileName' : fileName,
            'parseError' : str(errorObject) }

class UtilitiesSerializationListException(UtilitiesException):
    """Error serializing an object list from XML."""

    SERIALIZATION_LIST_ERROR = """
Error loading list '%(listName)s' containing items '%(itemName)s'
from XML document '%(fileName)s.xml' :
%(parseError)s"""

    def __init__(self, fileName, listName, itemName):
        """Initialize the UtilitiesSerializationListException object."""
        errorClass, errorObject, traceBack = sys.exc_info()
        self.value_ = UtilitiesSerializationListException.SERIALIZATION_LIST_ERROR % {
            'fileName' : fileName,
            'itemName' : itemName,
            'listName' : listName,
            'parseError' : str(errorObject) }


<filename>gensrc/gensrc/utilities/exceptions.py

"""
 Copyright (C) 2008 <NAME>

 This file is part of QuantLib, a free-software/open-source library
 for financial quantitative analysts and developers - http://quantlib.org/

 QuantLib is free software: you can redistribute it and/or modify it
 under the terms of the QuantLib license.  You should have received a
 copy of the license along with this program; if not, please email
 <<EMAIL>>. The license is also available online at
 <http://quantlib.org/license.shtml>.

 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 license for more details.
"""

"""Exceptions encountered when performing utility functions."""

from gensrc.exceptions import exceptions
import sys

class UtilitiesException(exceptions.GensrcException):
    """Exceptions encountered when performing utility functions."""

class UtilitiesSerializationException(UtilitiesException):
    """Error serializing an object from XML."""

    SERIALIZATION_ERROR = """
Error loading object of class '%(className)s' from XML document '%(fileName)s.xml' :
%(parseError)s"""

    def __init__(self, fileName, className):
        """Initialize the UtilitiesSerializationException object."""
        errorClass, errorObject, traceBack = sys.exc_info()
        self.value_ = UtilitiesSerializationException.SERIALIZATION_ERROR % {
            'className' : className,
            'fileName' : fileName,
            'parseError' : str(errorObject) }

class UtilitiesSerializationListException(UtilitiesException):
    """Error serializing an object list from XML."""

    SERIALIZATION_LIST_ERROR = """
Error loading list '%(listName)s' containing items '%(itemName)s'
from XML document '%(fileName)s.xml' :
%(parseError)s"""

    def __init__(self, fileName, listName, itemName):
        """Initialize the UtilitiesSerializationListException object."""
        errorClass, errorObject, traceBack = sys.exc_info()
        self.value_ = UtilitiesSerializationListException.SERIALIZATION_LIST_ERROR % {
            'fileName' : fileName,
            'itemName' : itemName,
            'listName' : listName,
            'parseError' : str(errorObject) }


Copyright (C) 2008 <NAME>   This file is part of QuantLib, a free-software/open-source library  for financial quantitative analysts and developers - http://quantlib.org/   QuantLib is free software: you can redistribute it and/or modify it  under the terms of the QuantLib license.  You should have received a  copy of the license along with this program; if not, please email  <<EMAIL>>. The license is also available online at  <http://quantlib.org/license.shtml>.   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 license for more details. Exceptions encountered when performing utility functions. Exceptions encountered when performing utility functions. Error serializing an object from XML. Error loading object of class '%(className)s' from XML document '%(fileName)s.xml' : %(parseError)s Initialize the UtilitiesSerializationException object. Error serializing an object list from XML. Error loading list '%(listName)s' containing items '%(itemName)s' from XML document '%(fileName)s.xml' : %(parseError)s Initialize the UtilitiesSerializationListException object.