1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-07-29 20:21:48 +02:00

Allow routines to have configurable error reporting that is individual from global setting.

Potential fix for error handling that was being used in a way that had the opposite intended effect.
This commit is contained in:
Sandu Liviu Catalin
2020-04-10 08:30:22 +03:00
parent 19a245f3b1
commit a7f8584661
2 changed files with 22 additions and 1 deletions

View File

@@ -54,7 +54,7 @@ private:
, mIterations(0)
, mInterval(0)
, mSuspended(false)
, mQuiet(ErrorHandling::IsEnabled())
, mQuiet(GetSilenced())
, mEndure(false)
, mArgc(0)
, mArgv()
@@ -213,6 +213,7 @@ private:
static Time s_Prev; // Previous time point.
static Interval s_Intervals[SQMOD_MAX_ROUTINES]; // List of intervals to be processed.
static Instance s_Instances[SQMOD_MAX_ROUTINES]; // List of routines to be executed.
static bool s_Silenced; // Error reporting independent from global setting.
private:
@@ -639,6 +640,22 @@ public:
{
GetValid().mEnv.Release();
}
/* --------------------------------------------------------------------------------------------
* See if error reporting is enabled for all newlly created routines.
*/
static bool GetSilenced()
{
return s_Silenced;
}
/* --------------------------------------------------------------------------------------------
* Set if error reporting should be enabled for all newlly created routines.
*/
static void SetSilenced(bool toggle)
{
s_Silenced = toggle;
}
};
} // Namespace:: SqMod