public static void RenderError(HttpResponse response, VBScriptCompilerException exception) { response.Clear(); response.StatusCode = 500; response.StatusDescription = "Internal Server Error"; RenderError(response.Output, exception); response.End(); }
public static void RenderError(ViewContext context, VBScriptCompilerException exception) { var response = context.HttpContext.Response; response.Clear(); response.StatusCode = 500; RenderError(context.Writer, exception); }
public static async Task RenderError(HttpResponse response, VBScriptCompilerException exception) { response.Clear(); response.StatusCode = 500; // response. // response.StatusDescription = "Internal Server Error"; await writeErrorOutput(response, exception); // response.Body.EndWrite(); }
public static async Task writeErrorOutput(HttpResponse output, VBScriptCompilerException exception) { await output.WriteAsync("<h1>VBScript Compiler Error</h1>"); await output.WriteAsync("<table>"); await output.WriteAsync("<tr>"); await output.WriteAsync(string.Format("<td>{0}</td>", "FileName")); await output.WriteAsync(string.Format("<td>{0}</td>", "Line")); await output.WriteAsync(string.Format("<td>{0}</td>", "Column")); await output.WriteAsync(string.Format("<td>{0}</td>", "Error Code")); await output.WriteAsync(string.Format("<td>{0}</td>", "Error Description")); await output.WriteAsync("</tr>"); foreach (VBScriptSyntaxError error in exception.SyntaxErrors) { await output.WriteAsync("<tr>"); await output.WriteAsync(string.Format("<td>{0}</td>", error.FileName)); await output.WriteAsync(string.Format("<td>{0}</td>", error.Span.Start.Line)); await output.WriteAsync(string.Format("<td>{0}</td>", error.Span.Start.Column)); await output.WriteAsync(string.Format("<td>{0}</td>", error.ErrorCode)); await output.WriteAsync(string.Format("<td>{0}</td>", error.ErrorDescription)); await output.WriteAsync("</tr>"); } await output.WriteAsync("</table>"); }
public static void RenderError(TextWriter output, VBScriptCompilerException exception) { output.Write("<h1>VBScript Compiler Error</h1>"); output.Write("<table>"); output.Write("<tr>"); output.Write(string.Format("<td>{0}</td>", "FileName")); output.Write(string.Format("<td>{0}</td>", "Line")); output.Write(string.Format("<td>{0}</td>", "Column")); output.Write(string.Format("<td>{0}</td>", "Error Code")); output.Write(string.Format("<td>{0}</td>", "Error Description")); output.Write("</tr>"); foreach (VBScriptSyntaxError error in exception.SyntaxErrors) { output.Write("<tr>"); output.Write(string.Format("<td>{0}</td>", error.FileName)); output.Write(string.Format("<td>{0}</td>", error.Span.Start.Line)); output.Write(string.Format("<td>{0}</td>", error.Span.Start.Column)); output.Write(string.Format("<td>{0}</td>", error.ErrorCode)); output.Write(string.Format("<td>{0}</td>", error.ErrorDescription)); output.Write("</tr>"); } output.Write("</table>"); }