question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When exception is thrown in production with WebMarkupMin turned on... error page returns as garbled/garbage/weird characters.

See original GitHub issue

To give as much information as possible: Controller: Research, ActionResult: Finish makes a call to a [NonAction] void FulfillPapers in the BaseController and while processing papers e-mailer throws an exception, this is expected (which is intercepted by Application_Error at the application level. Which I then run ErrorController.ExecuteErrorController(httpContext, httpContext.Request, exception); and throw the generic error page for the customer. This page returns back garbled when it is running in production, staging/test works fine. Perhaps the compression filter is being applied twice once on the original page and once again on the new page??? Any thoughts what to look for? capture

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
Taritsyncommented, Aug 23, 2018

Be sure to try the code from my previous comment. It seems, that your code from the Application_Error method does not allow my error handler to run.

1reaction
Taritsyncommented, Aug 23, 2018

Try adding the following code to beginning of the Application_Error method:

HttpContext httpContext = ((HttpApplication)sender).Context;
if (httpContext.Items.Contains("originalResponseFilter"))
{
	var originalResponseFilter = httpContext.Items["originalResponseFilter"] as Stream;
	if (originalResponseFilter != null)
	{
		httpContext.Response.Filter = originalResponseFilter;
	}
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

ASP.NET WebService Returns Gibberish Characters When ...
I have a web service (ASMX) and in it, a web method that does some work and throws an exception if the input...
Read more >
Handle errors in ASP.NET Core
Production error pages should be tested thoroughly and take extra care to avoid throwing exceptions of their own.
Read more >
How to use the Developer Exception Page in ASP.NET ...
The Developer Exception Page is not enabled when the application is running in the Production environment.
Read more >
Get Started with Custom Error Handling in Spring Boot (Java)
Learn how to implement custom error handling logic in Spring Boot. ... can handle exceptions thrown from any place in your application.
Read more >
How to Throw Exceptions in Python
Python throws the TypeError exception when there are wrong data types. Similar to TypeError, there are several built-in exceptions like: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found