Closed jgottula closed 10 years ago
Any method besides parsing the exception message string is OK with me. On Sep 5, 2014 3:24 PM, "Justin Gottula" notifications@github.com wrote:
Some of the error conditions (e.g. trying to add a duplicate connection in addConnection) result in a runtime_error exception being thrown.
I can see that BOOST_CHECK_THROW is used to check that a runtime_error is thrown. But how do we know that the right throw statement was hit, given that there may be multiple cases in a given function where runtime_error could be thrown, each for different reasons?
Do we create our own exception subclasses for each type of error? Do we try to parse the runtime_error's string? Do we even care? I suspect we may not need to care, but I wanted to see what your opinion on this is.
— Reply to this email directly or view it on GitHub https://github.com/bgottula/noodles/issues/14.
I will probably make a file with some extremely basic skeleton exception classes for this and update the throw
s and unit tests appropriately.
Added in 1ae0dfb063f90b097ad649c548e9450a540bf89e.
Some of the error conditions (e.g. trying to add a duplicate connection in
addConnection
) result in aruntime_error
exception being thrown.I can see that
BOOST_CHECK_THROW
is used to check that aruntime_error
is thrown. But how do we know that the rightthrow
statement was hit, given that there may be multiple cases in a given function whereruntime_error
could be thrown, each for different reasons?Do we create our own exception subclasses for each type of error? Do we try to parse the
runtime_error
's string? Do we even care? I suspect we may not need to care, but I wanted to see what your opinion on this is.