Throw exceptions instead of exit(1)? (Lintian warning)

Issue #427 closed
José Luis Blanco-Claraco created an issue

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)

  1. Log in to comment