Class InvalidReferenceException
java.lang.Object
java.lang.Throwable
java.lang.Exception
dev.zucca_ops.kustomtrace.exceptions.KustomException
dev.zucca_ops.kustomtrace.exceptions.InvalidReferenceException
- All Implemented Interfaces:
Serializable
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:
-
Field Summary
Fields inherited from class dev.zucca_ops.kustomtrace.exceptions.KustomException
path -
Constructor Summary
ConstructorsConstructorDescriptionInvalidReferenceException(String message) Constructs an InvalidReferenceException with a message.InvalidReferenceException(String message, Path path) Constructs an InvalidReferenceException with a message and the path related to the invalid reference.InvalidReferenceException(String message, Path path, boolean isError) Constructs an InvalidReferenceException with a message, path, and an explicit error/warning flag.InvalidReferenceException(String message, Path path, Throwable cause) Constructs an InvalidReferenceException with a message, path, and a causing throwable. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisError()Checks if this invalid reference represents a critical error.Methods inherited from class dev.zucca_ops.kustomtrace.exceptions.KustomException
getPathMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
InvalidReferenceException
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
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- ThePathof the file or reference causing the issue.
-
InvalidReferenceException
Constructs an InvalidReferenceException with a message, path, and an explicit error/warning flag.- Parameters:
message- The detail message.path- ThePathof the file or reference causing the issue.isError-trueif this should be treated as a critical error,falseif it's a warning or less severe issue.
-
InvalidReferenceException
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- ThePathof 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:
trueif this instance represents an error,falseif it should be treated as a warning or less severe issue.
-