public class UserNotInRoleException extends RuntimeException implements WithErrorResponse
Constructor and Description |
---|
UserNotInRoleException(User user,
Role role)
Creates the exception with an error message based on the given user and role.
|
UserNotInRoleException(User user,
Role role,
String message)
Creates the exception by delegating the message to the super constructor and storing the user and the rule.
|
UserNotInRoleException(User user,
Role role,
String message,
Throwable cause)
Creates the exception by delegating the message and the causing exception to the super constructor and storing
the user and the rule.
|
Modifier and Type | Method and Description |
---|---|
ResponseWithErrorCode |
getErrorResponse()
Gets the response containing an HTTP error code.
|
Role |
getRole() |
User |
getUser() |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public UserNotInRoleException(@Nullable User user, @Nullable Role role)
user
- The user which didn't have the needed role.role
- The role which the user didn't have.public UserNotInRoleException(@Nullable User user, @Nullable Role role, String message)
user
- The user which didn't have the needed role.role
- The role which the user didn't have.message
- The exception message.public UserNotInRoleException(@Nullable User user, @Nullable Role role, String message, Throwable cause)
user
- The user which didn't have the needed role.role
- The role which the user didn't have.message
- The exception message.cause
- The exception that caused the exception to be created.@Nonnull public ResponseWithErrorCode getErrorResponse()
WithErrorResponse
getErrorResponse
in interface WithErrorResponse
Copyright © 2019 SAP SE. All rights reserved.