Package com.google.api.pathtemplate
Class ValidationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.IllegalArgumentException
com.google.api.pathtemplate.ValidationException
- All Implemented Interfaces:
Serializable
Exception thrown if there is a validation problem with a path template, http config, or related
framework methods. Comes as an illegal argument exception subclass. Allows to globally set a
thread-local validation context description which each exception inherits.
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionValidationException(String format, Object... args) Construct validation exception with implicit context. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidClears the validation context.static voidSets the validation context description.static voidpushCurrentThreadValidationContext(String context) Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ValidationException
Construct validation exception with implicit context.
-
-
Method Details
-
pushCurrentThreadValidationContext
public static void pushCurrentThreadValidationContext(ValidationException.Supplier<String> supplier) Sets the validation context description. Each thread has its own description, so this is thread safe. -
pushCurrentThreadValidationContext
-
popCurrentThreadValidationContext
public static void popCurrentThreadValidationContext()Clears the validation context.
-