Throw exceptions instead of exit(1)? (Lintian warning)
Issue #427
closed
Hi all,
I found in a couple of places that exit(1)
is called in case of "fatal errors", e.g.:
std::cout
<< "SmartStereoProjectionHessianFactor: this->measured_.size() inconsistent with input"
<< std::endl;
exit(1);
However, it seems that directly calling exit() from a library is not recommended, for example, see this Debian lintian warning.
An alternative might be throwing std::runtime_error()
... does it make sense?
I could make a PR if you like the idea.
Cheers
Comments (3)
-
-
- changed status to closed
exit()-> throw (Closes
#427)→ <<cset 1304d26e81dd>>
-
Merged in jlblancoc/gtsam/fixes-jl (pull request #408)
exit()-> throw (Closes
#427)Approved-by: Frank Dellaert dellaert@cc.gatech.edu
→ <<cset 0b4f8da22e58>>
- Log in to comment
Definitely! If you're doing the other PR, just roll it in :-)