Package com.jk.core.exceptions
Class JKHttpException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.jk.core.exceptions.JKException
com.jk.core.exceptions.JKHttpException
- All Implemented Interfaces:
Serializable
This class represents exception thrown to indicate an data HTTP-related
errors within the application
This exception is a subclass of JKException
.
This class should be used to represent situations where an HTTP request or response encounters an error condition.
- Version:
- 1.0
- Author:
- Dr. Jalal H. Kiswani
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionThis method constructs a newJKHttpException
without any specified errors or causes.JKHttpException
(String message, int errorCode) This method constructs aJKHttpException
with a specific error message and code.JKHttpException
(String message, Throwable cause) This method constructs aJKHttpException
with a specific error message and a cause.JKHttpException
(Throwable cause) This method constructs aJKHttpException
with a cause. -
Method Summary
Modifier and TypeMethodDescriptionint
This method gets the error code of this exception.void
setErrorCode
(int errorCode) This methods replaces the current the error code of this exception.Methods inherited from class com.jk.core.exceptions.JKException
isLogged, setLogged
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
JKHttpException
public JKHttpException()This method constructs a newJKHttpException
without any specified errors or causes.This constructor is typically used when the exception is thrown to represent a specific error condition without additional details.
-
JKHttpException
This method constructs aJKHttpException
with a specific error message and code.- Parameters:
message
- Specifies the error message explaining the HTTP error.errorCode
- Specifies the error code of this exception.
-
JKHttpException
This method constructs aJKHttpException
with a specific error message and a cause.- Parameters:
message
- Specifies the error message explaining the HTTP error.cause
- Specifies the cause of this exception.
-
JKHttpException
This method constructs aJKHttpException
with a cause.- Parameters:
cause
- Specifies the cause of this exception.
-
-
Method Details
-
getErrorCode
public int getErrorCode()This method gets the error code of this exception.- Returns:
- the error code of this exception.
-
setErrorCode
public void setErrorCode(int errorCode) This methods replaces the current the error code of this exception.- Parameters:
errorCode
- Specifies the new error code.
-