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.

另请参见:
序列化表格

构造方法摘要
HttpException(HttpStatus status, List<ErrorResult> errors)
           
HttpException(HttpStatus status, String key)
           
HttpException(HttpStatus status, String key, String message)
           
HttpException(String key)
           
HttpException(String key, String message)
           
 
方法摘要
 Object getContent()
          Returns the content to use in the HTTP response generated for this exception.
 HttpStatus getStatus()
           
 
从类 java.lang.Throwable 继承的方法
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

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.