cn.dreampie.common.http.exception
类 HttpException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cn.dreampie.common.http.exception.HttpException
- 所有已实现的接口:
- Serializable
public class HttpException
- extends RuntimeException
Created by ice on 14-12-19.
A HttpException 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 |
HttpException
public HttpException(String key)
HttpException
public HttpException(HttpStatus status,
String key)
HttpException
public HttpException(String key,
String message)
HttpException
public HttpException(HttpStatus status,
String key,
String message)
HttpException
public HttpException(HttpStatus status,
List<ErrorResult> errors)
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 © 2017. All rights reserved.