Skip to content

Increase debugability with better error message #8

Description

@benjamin-dreux

See the following exemple

.option()
    .text("$")
    .attrValue("CAD")
    .<FileGeneralInformationsEditModel>dynamic((option, model) -> 
        option.attrSelected(model.requestedAmountCurrency().equals("CAD"))
    )
.__()

Have a view containing this will produce the following error message

java.lang.IllegalStateException: Cannot add attributes after!!!
	at htmlflow.visitor.HtmlVisitor.visitAttribute(HtmlVisitor.java:179) ~[htmlflow-4.3.jar:na]
	at org.xmlet.htmlapifaster.ElementVisitor.visitAttributeValue(ElementVisitor.java:1729) ~[htmlApiFaster-1.0.15.jar:na]
	at org.xmlet.htmlapifaster.Option.attrValue(Option.java:65) ~[htmlApiFaster-1.0.15.jar:na]
	at get.simple.today.lender.generalInformations.FileGeneralInformationsEditView.requestedAmountField(FileGeneralInformationsEditView.java:400) ~[classes/:na]

Sure there is the class name/method and line number. But the exception message could be enhanced to help user scan faster the error.

For exemple the following would be a enhancement in my opinion
Cannot add attributes (name of the attribute) after the current element opening tag (name of the tag) has been completed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions