[MAGNOLIA-7212] Problems detected by DefinitionProviderBuilder are not mentioned in Exception Created: 01/Dec/17  Updated: 01/Dec/17

Status: Open
Project: Magnolia
Component/s: configuration
Affects Version/s: 5.5.4
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Marty Glaubitz Assignee: Unassigned
Resolution: Unresolved Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)

 Description   

I was migrating a component definition from XML to YAML. Somehow, a Tab character got into my otherwise with spaces indented YAML file. This caused the DefinitionProviderBuilder to throw an Exception at the get method (Line 218):

@Override
public T get() {
    if (!valid) {
        throw new Registry.InvalidDefinitionException(metadata.getReferenceId());
    }
    return definition;
}

Although the reason why this definition is considered not valid is determined in the very same class (inside the problems property), they are not included into the exceptions message. This makes determining the actual problem very hard, since i had to insert a breakpoint into the mentioned method and look into the values inside the provlems property.

Simply adding the problems to the exception message would do a great deal here


Generated at Mon Feb 12 04:21:46 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.