KatachiKonsistUnlocatableDeclarationException

A rejected element that cannot say where it is.

KonsistScope.must and its siblings accept any KoBaseProvider, because that is the bound declarations() comes back at. Almost everything Konsist hands back also carries KoPathProvider; one that does not could only be reported as a violation with no path, which the report format does not have a shape for.

Example 1: catch a rejection katachi could not point at a file

val failure = shouldThrow<KatachiArchitectureAssertionError> {
projectArchitecture.assert(FileConstraintCheck())
}
failure.violations.filterIsInstance<UncheckedFileConstraint>()
.single().cause.shouldBeInstanceOf<KatachiKonsistUnlocatableDeclarationException>()

Properties

Link copied to clipboard
open val cause: Throwable?
Link copied to clipboard

The simple type name of the element that could not be located.

Link copied to clipboard
open val message: String?