custom-errors

When I set customErrors mode=“Off” in azure I do not get the error information

一曲冷凌霜 提交于 2019-12-11 06:59:51
问题 I get this message: "The page cannot be displayed because an internal server error has occurred." my web.config <customErrors mode="Off"/> my Web.Debug.config/Web.Release.config <customErrors mode="Off" xdt:Transform="Replace"/> <compilation xdt:Transform="RemoveAttributes(debug)" /> 回答1: this solve the problem <system.webServer> <httpErrors errorMode="Detailed" /> <asp scriptErrorSentToBrowser="true"/> </system.webServer> 来源: https://stackoverflow.com/questions/43521260/when-i-set

Create custom error when it returns 404 in ASP.NET MVC

徘徊边缘 提交于 2019-12-11 01:23:08
问题 I've tried to search and found some solution on it. I tried it on but no luck. Most of the accepted solution is to configure your Web.config file I tried it but it still return the default error page <configuration> <system.web> <customErrors mode="On"> <error statusCode="404" redirect="~/Error/Error404" /> </customErrors> </system.web> </configuration> any other way on how to configure it? I don't want to configure it in IIS 回答1: This solution doesn't need web.config file changes or catch

Override Spring form error messages

…衆ロ難τιáo~ 提交于 2019-12-10 15:12:50
问题 In Spring how do I override default form error massages ? I'm using a Validator and a properties file to add my own error messages, but how do I override messages that get printed on conversion/encoding error for example ? They seem to be generated automatically and I don't think are helpful for the user: Failed to convert property value of type java.lang.String to required type java.lang.Double for property minPrice; nested exception is java.lang.NumberFormatException: 回答1: You can override

Custom Errors works for HttpCode 403 but not 500?

99封情书 提交于 2019-12-10 14:36:24
问题 I am implementing custom errors in my MVC3 app, its switched on in the web.config: <customErrors mode="On"> <error statusCode="403" redirect="/Errors/Http403" /> <error statusCode="500" redirect="/Errors/Http500" /> </customErrors> My controller is very simple, with corresponding correctly named views: public class ErrorsController : Controller { public ActionResult Http403() { return View("Http403"); } public ActionResult Http500() { return View("Http500"); } } To test, I am throwing

ASP.NET customErrors with mode=remoteOnly and global.asax handling exceptions

☆樱花仙子☆ 提交于 2019-12-10 13:09:19
问题 I have custom errors set in the web config file as follows: <customErrors mode="RemoteOnly" defaultRedirect="GenericError.aspx" /> Fine and dandy... I like that mode="RemoteOnly" facilitates development... For unhandled exceptions, I have in global.asax: Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs) Response.Redirect("GenericError.aspx") End Sub However, unhandled exceptions are going to the generic error page instead of the informative yellow screen of death preferred

Web.config isn't showing errors remotely even with customErrors=“Off” (on ubuntu/mono)

限于喜欢 提交于 2019-12-10 12:49:20
问题 Here is my Web.config file: <?xml version="1.0"?> <configuration> <system.web> <customErrors mode="Off" /> <compilation debug="true" strict="false" explicit="true /> <pages> <namespaces> <clear /> <add namespace="System" /> <add namespace="System.Collections" /> <add namespace="System.Collections.Generic" /> <add namespace="System.Collections.Specialized" /> <add namespace="System.Configuration" /> <add namespace="System.Text" /> <add namespace="System.Text.RegularExpressions" /> <add

How to send status code “500” for generic error page in IIS?

假装没事ソ 提交于 2019-12-10 02:06:42
问题 I am using a generic error page using ASP.NET's <customErrors> directive. <customErrors mode="On" defaultRedirect="500.html" redirectMode="ResponseRewrite"> </customErrors> Problem - when an error occurs, this page does not return HTTP status "500". It comes as 200. So link checkers and spiders do not see that there is any problem. How can I send the 500 HTTP status along with the static 500.html page? Requirements: I must use redirectMode="ResponseRewrite" I can't use a dynamic page, only

Custom errors override in ASP.NET MVC area

旧巷老猫 提交于 2019-12-09 13:07:17
问题 I would like to have custom error pages unique to an MVC area. Unfortunately, it appears that the Web.config override system doesn't take the MVC folder structure into account. If I want to override an area called "mobile", I have to create a root project folder (in with Views and Controllers) named "mobile" and put the Web.config in there with the new customErrors element. Is there some better way to do this so that I don't have to create a root folder for any overrides? 回答1: I've been

Adding an error message to a custom validator

岁酱吖の 提交于 2019-12-08 15:58:30
问题 I have a custom validator and I am trying to output an error message when it fails but have been unable to do so. Could someone please tell me if I am doing this in the correct place. class User < ActiveRecord::Base self.table_name = "user" attr_accessible :name, :ip, :printer_port, :scanner_port validates :name, :presence => true, :length => { :maximum => 75 }, :uniqueness => true validates :ip, :length => { :maximum => 75 }, :allow_nil => true validates :printer_port, :presence => true, :if

Spring MVC custom errors and internationalization

寵の児 提交于 2019-12-08 04:05:12
问题 In my web application, I handle errors with annotations. Everything works fine and I can use custom messages via the "message" parameter. @Digits(fraction = 0, integer = 3, message="my custom error message...") private String price; Now I'm trying to internationalize this message with a .properties files, but I certainly miss something and I can't get it to work. My spring config : <beans:bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"