Class BadRequestException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
me.josephsf.jobportaljosephsfeir.exception.BadRequestException
- All Implemented Interfaces:
Serializable
Exception thrown when a client sends a request with invalid parameters or data.
This exception is automatically mapped to an HTTP 400 BAD_REQUEST response status
by Spring using the ResponseStatus annotation. It's used throughout the
Job Portal application when validation fails or when the client provides inappropriate
values that cannot be processed by the application.
Examples of when this exception might be thrown:
- User tries to register with an email that's already in use
- Candidate applies to a job they've already applied to
- Recruiter creates a job with invalid salary range
- User submits data that fails validation rules
- Since:
- 2025-05-15
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBadRequestException(String message) Constructs a new bad request exception with the specified detail message.BadRequestException(String message, Throwable cause) Constructs a new bad request exception with the specified detail message and cause. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
BadRequestException
Constructs a new bad request exception with the specified detail message.- Parameters:
message- the detail message (which is saved for later retrieval by theThrowable.getMessage()method)
-
BadRequestException
Constructs a new bad request exception with the specified detail message and cause.- Parameters:
message- the detail message (which is saved for later retrieval by theThrowable.getMessage()method)cause- the cause (which is saved for later retrieval by theThrowable.getCause()method)
-