You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We also have
52 catch (50 in unit tests, 2 outised)
I think we should discuss where we stand on issuing warnings (cerr, none are followed by a throw) and notices (cout). Especially in recent code these are more common. Warning can be made errors of course and I think should if the result is an immidiate crash. I see no justification for asserts.
Also it seems boost exception throwing makes up for roughly a third. Do we need boost or can we suffice with std?
Perhaps we can write at least some guidelines on this on the wiki and perhaps make the code uniform. Overal, Tudat could do with a bit more checks and sanitization, but this is perhaps topic for a future discussion.
The text was updated successfully, but these errors were encountered:
In the latest update, we have significantly improved the consistency of the error messages. Cerr message are now only used for warnings, boost and std exceptions are still mixed, however
I've largely homogenized the exception handling: with one exception (the ConvergenceException class) all boost exceptions and assert statements have been removed.
All real errors are now handled by std::runtime_error (a total of 741 times). Warnings, which users should be aware of, but should not terminate the propagtion, are handled by std::cerr statements and, for a few rare cases, simple messages to the user are given by std::cout statements.
I noticed that handling of errors, warning and notifications in Tudat is not uniform at all. I did a quick analysis and found the following
182 throw std::runtime_error
96 std::cerr: for warning (none throw exceptions)
89 boost::throw_exception
4 assert
3 BOOST_THROW_EXCEPTION
2 throw("messsage")
1 std::cout: notification purposes.
We also have
52 catch (50 in unit tests, 2 outised)
I think we should discuss where we stand on issuing warnings (cerr, none are followed by a throw) and notices (cout). Especially in recent code these are more common. Warning can be made errors of course and I think should if the result is an immidiate crash. I see no justification for asserts.
Also it seems boost exception throwing makes up for roughly a third. Do we need boost or can we suffice with std?
Perhaps we can write at least some guidelines on this on the wiki and perhaps make the code uniform. Overal, Tudat could do with a bit more checks and sanitization, but this is perhaps topic for a future discussion.
The text was updated successfully, but these errors were encountered: