/// <summary> /// Adds a critical error to the list with the given error code and additional parameters to substitute /// and aborts the current operation with the reason being this message if required. /// </summary> /// <param name="code">The error code.</param> /// <param name="abort">True to abort the current operation.</param> /// <param name="parameters">An array of parameters to substitute into the message placeholders.</param> public void CriticalError(string code, bool abort, params object[] parameters) { ErrorMessage err = new ErrorMessage(code, GetMessage(code, parameters), ErrorSeverity.Critical); Add(err); if (abort) Abort(err.Message); }
/// <summary> /// Adds the given error message to the list. /// </summary> /// <param name="err">Error message to add to the list.</param> public void Add(ErrorMessage err) { errors.Add(err); }