//TODO: implement custom error hendling, to break dependency on csscript library /// <summary> /// Creates the <see cref="T:System.Exception"/> containing combined error information. /// Optionally warnings can also be included in the exception info. /// </summary> /// <param name="hideCompilerWarnings">The flag indicating if compiler warnings should be included in the error (<see cref="T:System.Exception"/>) info.</param> /// <returns>Instance of the <see cref="CompilerException"/>.</returns> public CompilerException CreateException() { var compileErr = new StringBuilder(); foreach (string err in Errors) { compileErr.AppendLine(err); } foreach (string item in Warnings) { compileErr.AppendLine(item); } CompilerException retval = new CompilerException(compileErr.ToString()); retval.Data.Add("Errors", Errors); retval.Data.Add("Warnings", Warnings); return(retval); }
public CompilerOutput(CompilerException ex) { Errors = (List <string>)ex.Data["Errors"]; Warnings = (List <string>)ex.Data["Warnings"]; }