I changed my error pages in mvc 4 following this discussion.
The problem is that when loading my page in error condition
Model != null && HttpContext.Current.IsDebuggingEnabled
ignores it and does not enter the condition. In web.config debug mode is enabled. By publishing it ignores and does not enter the condition, not showing the error on the test server. This missing something? Thank you.