cantera/interfaces/python/Cantera/exceptions.py
Ray Speth 2528df0f75 Reorganized source tree structure
These changes make it unnecessary to copy header files around during
the build process, which tends to confuse IDEs and debuggers. The
headers which comprise Cantera's external C++ interface are now in
the 'include' directory.

All of the samples and demos are now in the 'samples' subdirectory.
2012-02-12 02:27:14 +00:00

27 lines
681 B
Python
Executable file

"""
Cantera exceptions
"""
import _cantera
def getCanteraError():
"""
Get an error message generated when Cantera throws an exception.
"""
return _cantera.get_Cantera_Error()
class CanteraError(Exception):
def __init__(self, msg = ""):
if msg == "":
msg = _cantera.get_Cantera_Error()
self.msg = msg
def __str__(self):
print '\n\n\n####################### CANTERA ERROR ######################\n'
print ' ',self.msg
print '\n##############################################################\n'
class OptionError(CanteraError):
def __init__(self, msg):
self.msg = 'Unknown option: '+msg