bgottula / noodles

Framework for DSP flowgraphs.
MIT License
1 stars 0 forks source link

Determine how Boost UTF should handle exceptions #14

Closed jgottula closed 10 years ago

jgottula commented 10 years ago

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.

bgottula commented 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.

jgottula commented 10 years ago

I will probably make a file with some extremely basic skeleton exception classes for this and update the throws and unit tests appropriately.

jgottula commented 10 years ago

Added in 1ae0dfb063f90b097ad649c548e9450a540bf89e.