Skip to content

Commit

Permalink
Don't catch std::exception in Debug mode so we can catch array bounds…
Browse files Browse the repository at this point in the history
… error in debugger

cmake will properly define NDEBUG on msvc as well in release mode
cf https://gitlab.kitware.com/cmake/cmake/-/blob/1e35163a/Modules/Platform/Windows-MSVC.cmake#L481-483
  • Loading branch information
jmarrec committed Aug 21, 2024
1 parent 07dbb5b commit ce1bde5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/EnergyPlus/api/EnergyPlusPgm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -419,10 +419,13 @@ int RunEnergyPlus(EnergyPlus::EnergyPlusData &state, std::string const &filepath
EnergyPlus::SimulationManager::ManageSimulation(state);
} catch (const EnergyPlus::FatalError &e) {
return EnergyPlus::AbortEnergyPlus(state);
#ifdef NDEBUG
} catch (const std::exception &e) {
ShowSevereError(state, e.what());
return EnergyPlus::AbortEnergyPlus(state);
#endif
}

return wrapUpEnergyPlus(state);
}

Expand Down

4 comments on commit ce1bde5

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debug_array (jmarrec) - Win64-Windows-10-VisualStudio-16: OK (2871 of 2871 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debug_array (jmarrec) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (3706 of 3706 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debug_array (jmarrec) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-Debug: OK (2077 of 2077 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debug_array (jmarrec) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-Debug: OK (797 of 797 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.