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

public class UnauthorizedException extends RuntimeException
An exception thrown when a user is not authorized to perform a certain action.
Author:
Brage Halvorsen Kvamme, Trym Hamer Gudvangen
See Also:
  • Constructor Details

    • UnauthorizedException

      public UnauthorizedException(String username)
      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

      public UnauthorizedException(String username, String message)
      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.