Class InvalidReferenceException

All Implemented Interfaces:
Serializable

public class InvalidReferenceException extends KustomException
Exception thrown when a reference in a Kustomization file is invalid, unresolvable, or malformed.

This exception can distinguish between errors and warnings via the isError() flag, allowing for more nuanced error reporting or handling.

See Also:
  • Constructor Details

    • InvalidReferenceException

      public InvalidReferenceException(String message)
      Constructs an InvalidReferenceException with a message. The associated path defaults to a placeholder "invalid" path. Assumes this is a warning by default.
      Parameters:
      message - The detail message.
    • InvalidReferenceException

      public InvalidReferenceException(String message, Path path)
      Constructs an InvalidReferenceException with a message and the path related to the invalid reference. Assumes this is a warning by default.
      Parameters:
      message - The detail message.
      path - The Path of the file or reference causing the issue.
    • InvalidReferenceException

      public InvalidReferenceException(String message, Path path, boolean isError)
      Constructs an InvalidReferenceException with a message, path, and an explicit error/warning flag.
      Parameters:
      message - The detail message.
      path - The Path of the file or reference causing the issue.
      isError - true if this should be treated as a critical error, false if it's a warning or less severe issue.
    • InvalidReferenceException

      public InvalidReferenceException(String message, Path path, Throwable cause)
      Constructs an InvalidReferenceException with a message, path, and a causing throwable. Assumes this is an error by default when a cause is provided.
      Parameters:
      message - The detail message.
      path - The Path of the file or reference causing the issue.
      cause - The underlying cause of this exception.
  • Method Details

    • isError

      public boolean isError()
      Checks if this invalid reference represents a critical error.
      Returns:
      true if this instance represents an error, false if it should be treated as a warning or less severe issue.