Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to throw ErrorUml #13

Open
joaoe opened this issue Nov 26, 2018 · 2 comments
Open

Option to throw ErrorUml #13

joaoe opened this issue Nov 26, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@joaoe
Copy link

joaoe commented Nov 26, 2018

Hi !

I'm using Structurizr in my project, which uses plantuml. For unimportant reasons, structurizr generates some uml code that is not valid, e..g. empty title. My diagram is generated truncated with an error at the top Syntax error: title.

I'd like for plantuml not to generate and inject errors into my SVG diagram but instead to throw them so I can fix my program. As the program and diagram grows, it is quite unmaintainable to be debugging the output file manually to check for "syntax error".

So, suggestion: add flag to net.sourceforge.plantuml.OptionFlags like throwErrors and then each place an ErrorUml is created, throw it.

Thank you.

@arnaudroques
Copy link
Contributor

Good idea!
With last version 1.2018.13, there is a setSilentlyCompletelyIgnoreErrors(boolean) in OptionFlags class.
Currently it's only active in SourceFileReader class which may be not enough for you.
Can you tell us how you are integrating with PlantUML ?

Thanks,

@joaoe
Copy link
Author

joaoe commented Nov 26, 2018

I'm using Structurizr [1], which does not do any input validation, and then generates UML markup which apparently causes problems. Thank you.

[1] My code pretty much looks like this

// My code: fill in the model/workspace
Workspace workspace = new Workspace("title", "desc");

// Structurizr
StringWriter sw = new StringWriter();
PlantUMLWriter puw = new PlantUMLWriter()
puw.write(workspace, sw);

// And PlantUML
for (String section: sw.toString().split("(?=@startuml)")) {
  SourceStringReader reader = new SourceStringReader(section);
  reader.generateImage(os, new FileFormatoption(FileFormat.SVG));
  // write os to file
}

@arnaudroques arnaudroques added the enhancement New feature or request label Mar 19, 2023
@arnaudroques arnaudroques transferred this issue from plantuml/plantuml Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants