Class HttpException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.sure.tool.http.HttpException
- All Implemented Interfaces:
Serializable
HTTP 请求异常,携带响应状态码。
- Since:
- 0.1.0
- Author:
- suretool
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionHttpException(String message) 创建异常(无状态码)。HttpException(String message, int statusCode) 创建异常。HttpException(String message, Throwable cause) 创建异常。 -
Method Summary
Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
HttpException
-
HttpException
创建异常。- Parameters:
message- 错误信息statusCode- 响应状态码
-
HttpException
-
-
Method Details
-
getStatusCode
public int getStatusCode()响应状态码,无响应时为 -1。- Returns:
- 状态码
-