Class UnauthorizedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
edu.ntnu.idatt2106_2023_06.backend.exception.UnauthorizedException
- All Implemented Interfaces:
Serializable
An exception thrown when a user is not authorized to perform a certain action.
- Author:
- Brage Halvorsen Kvamme, Trym Hamer Gudvangen
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionThis method constructs an UnauthorizedException with a default error message indicating that the user is not authorized.UnauthorizedException
(String username) This method constructs an UnauthorizedException with a default error message indicating the username that is not authorized.UnauthorizedException
(String username, String message) This method constructs an UnauthorizedException with a custom error message and indicating the username that is not authorized. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
UnauthorizedException
This method constructs an UnauthorizedException with a default error message indicating the username that is not authorized.- Parameters:
username
- the username of the user that is not authorized.
-
UnauthorizedException
This method constructs an UnauthorizedException with a custom error message and indicating the username that is not authorized.- Parameters:
username
- the username of the user that is not authorized.message
- the custom error message.
-
UnauthorizedException
public UnauthorizedException()This method constructs an UnauthorizedException with a default error message indicating that the user is not authorized.
-