ExceptionBuilder

Building a JAVA Exception with FlowerDocs identifiers

The

ExceptionBuilder” builder can be used to create TechnicalException or FunctionalException with an error code.

You can pass it one or more parameters, including FlowerDocs identifiers, which will be formatted when the error message is returned.


The following example shows how to create a TechnicalException with error code T00000 and a message indicating the problem :


    Id tagId = new Id("idMyTag");
    ExceptionBuilder.createTechnicalException(T00000, "Tag {} cannot have the value {}", tagId, "wrongValue", e);
  • With the builder : “Tag idMyTag cannot have the value wrongValue”.
  • Without the builder : “Tag [Id=(value=“idMyTag”)] cannot have the value wrongValue”.