//... protected virtual void OnExceptionUnhandled(UnhandledExceptions type, Exception e) { var error = new Error(e); _ = Dispatcher.BeginInvoke(() => Log.Write <BaseApplication>(error)); ExceptionUnhandled?.Invoke(this, new UnhandledExceptionEventArgs(type, error)); }
private bool RunHandlerLevel(params IExecutableHandler[] levelHandlerList) { bool successfulExecution = true; foreach (IExecutableHandler handler in levelHandlerList) { try { successfulExecution = handler.Execute(DataContext); } catch (QLBaseException ex) { DataContext.ASTHandlerExceptions.Add(ex); successfulExecution = false; } catch (Exception ex) { //not known exception! UnhandledExceptions.Add(ex); successfulExecution = false; } if (!successfulExecution) { break; } } return(successfulExecution); }
public UnhandledExceptionEventArgs(UnhandledExceptions type, Error error) : base() { Type = type; Error = error; }