protected internal virtual bool OnExceptionHandler(System.Exception exc, string funcFootprint, InvokeVerbosity verbosity = InvokeVerbosity.Default) { IsSuccessful = false; Exception = exc; //// only call exception if verbosity flag for it is set. //if (!IsSet(verbosity, InvokeVerbosity.OnException)) // return; if (_onExceptionHandler == null) return false; _onExceptionHandler(this, exc, funcFootprint); return true; }
protected internal override bool OnExceptionHandler(Exception exc, string functionInfo, InvokeVerbosity verbosity = InvokeVerbosity.Verbose) { if (base.OnExceptionHandler(exc, functionInfo, verbosity)) return true; // only log exception if verbosity flag for it is set. if (!IsSet(verbosity, InvokeVerbosity.OnException)) return true; try { if (_onLogExceptionHandler != null) { _onLogExceptionHandler(exc, Format("Failed calling {0}.", functionInfo)); return true; } } catch (TraceException internalExc) { OnEventExceptionHandler(EventType.OnException, internalExc, functionInfo); } return false; }
/// <summary> /// Checks whether a certain invoke verbosity flag is set. /// </summary> /// <param name="verbosity">Invoke Verbosity set by user or got by default.</param> /// <param name="flagToCheck">Invoke Verbosity flag to check.</param> /// <returns></returns> protected internal bool IsSet(InvokeVerbosity verbosity, InvokeVerbosity flagToCheck) { return (InvokeVerbosity)(verbosity & flagToCheck) == flagToCheck; }