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
IM_ASSERT_USER_ERROR() was designed to specifically cover errors that are safely recoverable.
So e.g.
IM_ASSERT_USER_ERROR(gp.CurrentPlot != nullptr && !gp.CurrentPlot->SetupLocked,
"Setup needs to be called after BeginPlot and before any setup locking functions (e.g. PlotX)!"); // get plot and axis
ImPlotPlot& plot = *gp.CurrentPlot;
The gp.CurrentPlot != nullptr part of it is incorrect.
I suggest not to take action right now as I am in the process of reworking this system to provide new error handling mechanisms.
I will try to post some update here eventually, but felt it was safer to leave the info down here.
The text was updated successfully, but these errors were encountered:
Calling IM_ASSERT_USER_ERROR() followed by a crash (e.g. in the case gp.CurrentPlot == NULL in my example above) is a little misleading, but not more damaging than an assert. Ideally the idea is that IM_ASSERT_USER_ERROR() should be in path where your code won't crash. I recommend only using it in entry points. Aka don't spam codebase with random calls to this in all leaf functions, but be considerate of what can the user errors cases be.
IM_ASSERT_USER_ERROR()
was designed to specifically cover errors that are safely recoverable.So e.g.
The
gp.CurrentPlot != nullptr
part of it is incorrect.I suggest not to take action right now as I am in the process of reworking this system to provide new error handling mechanisms.
I will try to post some update here eventually, but felt it was safer to leave the info down here.
The text was updated successfully, but these errors were encountered: