http-error

How do I display custom error pages in Asp.Net Mvc 3?

狂风中的少年 提交于 2019-11-26 18:55:30
问题 I want all 401 errors to be be redirected to a custom error page. I have initially setup the following entry in my web.config. <customErrors defaultRedirect="ErrorPage.aspx" mode="On"> <error statusCode="401" redirect="~/Views/Shared/AccessDenied.aspx" /> </customErrors> When using IIS Express I receive the stock IIS Express 401 error page. In the event when I do not use IIS Express a blank page is returned. Using Google Chrome's Network tab to inspect the response, I see that while the page

HTTPError: HTTP Error 503: Service Unavailable goslate language detection request : Python

折月煮酒 提交于 2019-11-26 16:51:15
问题 I have just started using the goslate library in Python to detect the language of the words in a text but after testing it for 7-8 inputs, I gave the input which had the words written in two languages, Arabic and English. After which, it started giving me the error. Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> execfile("C:/test_goslate.py"); File "C:/test_goslate.py", line 12, in <module> language_id = gs.detect('الدولة') File "C:\Python27\lib\site-packages

how to get access to error message from abort command when using custom error handler

爷,独闯天下 提交于 2019-11-26 16:38:49
问题 Using a python flask server, I want to be able to throw an http error response with the abort command and use a custom response string and a custom message in the body @app.errorhandler(400) def custom400(error): response = jsonify({'message': error.message}) response.status_code = 404 response.status = 'error.Bad Request' return response abort(400,'{"message":"custom error message to appear in body"}') But the error.message variable comes up as an empty string. I can't seem to find

HTTP Error 503, the service is unavailable

允我心安 提交于 2019-11-26 12:40:39
I'm really new to setting up web servers in general. I've got IIS 8 on Windows 8, and I'm trying to set up a little site locally, while doing some development. In IIS I choose Add Site, give a name, points to a location where I have a index.html file (I've tried different locations, latest in a c:\inetpub\wwwroot\test -folder) and otherwise use all default settings. However, when I try to browse to localhost I get HTTP Error 503. The service is unavailable. I've verified the pool is started, and I've given IIS_IUSRS Full Control on the target folder I've search around but not found anything

How to enable ASP classic in IIS7.5

会有一股神秘感。 提交于 2019-11-26 07:47:15
问题 I am running IIS 7.5 in Windows 7 and have already gone into \"Turn Windows features on or off\" and enabled ASP in \"Internet Information Services/World Wide Web Service/application Development Features\". Once I did that I started getting an HTTP 404 error saying: The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map. So I took this to mean that I needed to add a mapping

How to respond with HTTP 400 error in a Spring MVC @ResponseBody method returning String?

一笑奈何 提交于 2019-11-26 01:55:38
问题 I\'m using Spring MVC for a simple JSON API, with @ResponseBody based approach like the following. (I already have a service layer producing JSON directly.) @RequestMapping(value = \"/matches/{matchId}\", produces = \"application/json\") @ResponseBody public String match(@PathVariable String matchId) { String json = matchService.getMatchJson(matchId); if (json == null) { // TODO: how to respond with e.g. 400 \"bad request\"? } return json; } Question is, in the given scenario, what is the