Class NotFoundException

All Implemented Interfaces:
Serializable

public class NotFoundException extends RuntimeException
The not found exception is thrown when an object by reference or name is not found: a VirtualSpace or UI component looked up by name or path, a user, a group, a mail sender, a string ID or a file. It is unchecked: a lookup that cannot miss needs no clause, and a caller that handles the miss catches it by name.

Until CC-FIX-NOTFOUND-AND-RESET this class extended Error (from r13200, 2018). That was a trap: a catch ( Exception ) written around a lookup to handle the miss did not catch it, so the miss went on to the next catch ( Throwable ) up the stack and the handler's own recovery never ran - 17 such blocks at r20195 (CC-SURVEY-NOTFOUND), 11 of them in ServerAdmin. A catch ( Exception ) around a lookup now catches it; a catch ( Error ) no longer does.

Author:
Christopher Mindus
See Also:
  • Constructor Details

    • NotFoundException

      public NotFoundException(String message)
      Constructs a not found exception with just a message text.
      Parameters:
      message - The text message of the exception.
    • NotFoundException

      public NotFoundException(String message, Throwable cause)
      Constructs a not found exception with a nested exception.
      Parameters:
      message - The text message of the exception.
      cause - The nested exception that is the cause of this exception.