Web에서 HttpResponseException을 이용한 에러 노출
example
throw new HttpResponseException(HttpStatusCode.UnsupportedMediaType);
아래 상태별로 표준 에러를 표현해 줄 수 있다.
Continue = 100, SwitchingProtocols = 101, OK = 200, Created = 201, Accepted = 202, NonAuthoritativeInformation = 203, NoContent = 204, ResetContent = 205, PartialContent = 206, MultipleChoices = 300, Ambiguous = 300, MovedPermanently = 301, Moved = 301, Found = 302, Redirect = 302, SeeOther = 303, RedirectMethod = 303, NotModified = 304, UseProxy = 305, Unused = 306, RedirectKeepVerb = 307, TemporaryRedirect = 307, BadRequest = 400, Unauthorized = 401, PaymentRequired = 402, Forbidden = 403, NotFound = 404, MethodNotAllowed = 405, NotAcceptable = 406, ProxyAuthenticationRequired = 407, RequestTimeout = 408, Conflict = 409, Gone = 410, LengthRequired = 411, PreconditionFailed = 412, RequestEntityTooLarge = 413, RequestUriTooLong = 414, UnsupportedMediaType = 415, RequestedRangeNotSatisfiable = 416 ExpectationFailed = 417, UpgradeRequired = 426, InternalServerError = 500, NotImplemented = 501, BadGateway = 502, ServiceUnavailable = 503, GatewayTimeout = 504, HttpVersionNotSupported = 505,
'ASP.NET MVC' 카테고리의 다른 글
[ASP.NET] 새로운 버전의 ASP.NET MVC 5.2, Web API 2.2 and Web Pages 3.2가 발표가 되었다 (0) | 2014.08.23 |
---|---|
Knockout Generator - javascript 파일을 쉽게 만들자 (0) | 2014.04.18 |
HostingEnvironment를 이용한 호스팅 정보 활용 (0) | 2014.04.17 |
Real time Apps #6 - SignalR over WebSocket (0) | 2013.09.12 |
Real time Apps #5 - WebSocket (0) | 2013.09.10 |