0

I'm getting this exception message in the IDE output log even though I have a code that catches it, if it happens.

enter image description here

Here's the code itself:

t_ptr obj_ptr;

try {
    obj_ptr = _objects.at(file);   
}
catch (std::out_of_range e) {
    return nullptr;
}

return obj_ptr.get();

Is it supposed to happen? It's not like I'm using obj_ptr when std::map.at() fails.

McLovin
  • 3,295
  • 7
  • 32
  • 67

1 Answers1

3

"First-chance" exception means just that the debugger noticed that an exception has been thrown. That's not an error (and in facts the execution goes on), just an aid to the programmer that may be on the look for exceptions being incorrectly swallowed.

Matteo Italia
  • 123,740
  • 17
  • 206
  • 299