Class InvalidRequestException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.sourcelab.kafka.connect.apiclient.rest.exceptions.InvalidRequestException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ConcurrentConfigModificationException,ConnectionException,ResourceNotFoundException,ResultParsingException,UnauthorizedRequestException
public class InvalidRequestException extends RuntimeException
Represents when a request is invalid.
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description InvalidRequestException(String message, int errorCode)Constructor.InvalidRequestException(String message, Throwable cause)Constructor. -
Method Summary
Modifier and Type Method Description static InvalidRequestExceptionfactory(RequestErrorResponse errorResponse)Factory method to create proper exception class based on the error.intgetErrorCode()Resulting HTTP Status code.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
InvalidRequestException
Constructor.- Parameters:
message- Error message.errorCode- Http Error Code.
-
InvalidRequestException
Constructor.- Parameters:
message- Error message.cause- Originating exception.
-
-
Method Details
-
getErrorCode
public int getErrorCode()Resulting HTTP Status code.- Returns:
- Http Status Code.
-
factory
Factory method to create proper exception class based on the error.- Parameters:
errorResponse- Parsed error response from server.- Returns:
- Appropriate Exception class.
-