cn.dreampie.common.http.exception
类 WebException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cn.dreampie.common.http.exception.WebException
- 所有已实现的接口:
- Serializable
public class WebException
- extends RuntimeException
Created by ice on 14-12-19.
A WebException can be raised to make resty return immediately an HTTP response with a specific HTTP status.
- 另请参见:
- 序列化表格
| 从类 java.lang.Throwable 继承的方法 |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
WebException
public WebException(HttpStatus status)
WebException
public WebException(String message)
WebException
public WebException(Object content)
WebException
public WebException(HttpStatus status,
String message)
WebException
public WebException(HttpStatus status,
Object content)
getStatus
public HttpStatus getStatus()
getContent
public Object getContent()
- Returns the content to use in the HTTP response generated for this exception.
Developer's note: override to provide a content different from the exception message.
Alternatively you can override the writeTo method for full control over the response.
- 返回:
- the content to use in the response.
Copyright © 2015. All rights reserved.