custom-error-pages

How do I get ASP.NET MVC to honor my customErrors settings?

回眸只為那壹抹淺笑 提交于 2019-12-05 00:17:40
问题 In the customErrors tag in my web.config, I am pointing to a controller. In my controller I am redirecting to an external error page that is shared by multiple applications. <customErrors defaultRedirect="~/Error/ServerError" mode="On"> My controller: public class ErrorController : Controller { public ActionResult ServerError() { return Redirect("/Systems/ASPNETErrorHandling/ErrorPage.aspx"); } public ActionResult ErrorTest() { throw new Exception("testing error handling"); } } I'm calling

How to access HTTP StatusDescription in custom error page

不羁岁月 提交于 2019-12-04 16:17:28
When an action (asp.net mvc 5) cannot find something in the database, the user must see a page with a short custom error message e.g. "Invoice 5 does not exist" . Also, the response must have a 404 HTTP code. Another example: when the action is improperly called, the user must see e.g. "Parameter 'invoiceId' is required" . Also, the response must have a 400 HTTP code. I tried to store the custom messages in the HTTP status description and to display them in custom error pages. There are two approaches (afaik): A mvc action: return HttpNotFound("Invoice 5 does not exist"); OR return new

htaccess file deny from all, redirects to 404 not found on 403.shtml but no custom error pages defined

Deadly 提交于 2019-12-04 15:32:29
I'm setting up a quick internal project in a new addon domain in cPanel. This particular one has an SSL cert installed. I was building my .htaccess up and added a <Files config.php> directive to deny from all so that my config.php file isn't accessible. I realise that storing it outside of the web root is the ideal but I can't in this case. Normally I would expect that when going to www.domain.com/config.php in a browser that I would get Apache's default 403 Forbidden page. This is what happens on other domains on the same server. But in this case I'm being given a 404 not found error, stating

nginx not serving my error_page

≯℡__Kan透↙ 提交于 2019-12-03 08:08:37
问题 I have a Sinatra application hosted with Unicorn, and nginx in front of it. When the Sinatra application errors out (returns 500), I'd like to serve a static page, rather than the default "Internal Server Error". I have the following nginx configuration: server { listen 80 default; server_name *.example.com; root /home/deploy/www-frontend/current/public; location / { proxy_pass_header Server; proxy_set_header Host $http_host; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy

nginx not serving my error_page

天涯浪子 提交于 2019-12-02 21:40:47
I have a Sinatra application hosted with Unicorn, and nginx in front of it. When the Sinatra application errors out (returns 500), I'd like to serve a static page, rather than the default "Internal Server Error". I have the following nginx configuration: server { listen 80 default; server_name *.example.com; root /home/deploy/www-frontend/current/public; location / { proxy_pass_header Server; proxy_set_header Host $http_host; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Scheme $scheme; proxy_connect_timeout 5; proxy_read_timeout 240; proxy_pass http://127.0.0

Is it possible to submit a form that has been rendered from a JSF page location in WEB-INF?

假装没事ソ 提交于 2019-12-02 09:12:39
The JSF 2.2 web based application I am developing makes use of various error pages which are located in the WEB-INF directory and are displayed when an HTTP error or Java exception is encountered based on the configuration in the web.xml file. On some error pages I would like to include a form which allows the user to report the issue and include various attributes that would be helpful when investigating the issue such as the request URI and the error message. The issue I've got is when the user attempts to submit the form it fails with a page not found error as the HTTP post request method

Asp.net - Web.Config - Custom Errors

旧城冷巷雨未停 提交于 2019-12-01 23:15:57
问题 How can I set 404 and other error pages using web.config? I have tried adding following block in web.config. <customErrors defaultRedirect="Forms/Errors/Page_404.aspx" mode="On"> <error statusCode="500" redirect="servererror.aspx" /> <error statusCode="403" redirect="NoAccess.htm" /> <error statusCode="404" redirect="Forms/Errors/Page_404.aspx" /> </customErrors> but still its showing default error page of IIS7. How to fix this? 回答1: I solved it myself. We need to add another section in web

Create custom 404 error for each app on my django project?

与世无争的帅哥 提交于 2019-12-01 22:18:42
问题 is there a way to create multiple custom errors templates for each app on my Django project, I mean, in my project I got 3 apps I will show 3 different customs 404 error per each app. Right now I'm showing the same 404 error page for my back office app and front office. 回答1: Create a custom error view and assign it to handler404 variable in your root urls.py : from django.views.defaults import page_not_found def my_error_404(request, exception): template_name = '404.html' if request.path

500 error page not showing on Heroku

眉间皱痕 提交于 2019-12-01 21:04:59
I'm trying to get a custom 500 error page to show on Heroku, running rails 3.2.11 I've followed the steps at: https://devcenter.heroku.com/articles/error-pages The process worked fine for the maintenance page, but doesn't seem to work for the error page. I'm positive the S3 URL is correct in Heroku, and when I visit the S3 URL directly I can view the error page just fine (it is set to public). config.consider_all_requests_local is set to false in production.rb Any ideas as to why Heroku is not showing it? I just get a blank screen in various browsers (Chrome says it's a 500 error but doesn't

Asp.net - Web.Config - Custom Errors

旧巷老猫 提交于 2019-12-01 20:44:59
How can I set 404 and other error pages using web.config? I have tried adding following block in web.config. <customErrors defaultRedirect="Forms/Errors/Page_404.aspx" mode="On"> <error statusCode="500" redirect="servererror.aspx" /> <error statusCode="403" redirect="NoAccess.htm" /> <error statusCode="404" redirect="Forms/Errors/Page_404.aspx" /> </customErrors> but still its showing default error page of IIS7. How to fix this? Riz I solved it myself. We need to add another section in web.config like below to make it work in IIS 7 / 7.5. For IIS 6 the one works which I mentioned in my