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

Feature Request: Option for strict parsing #123

Open
linusclindgren opened this issue Feb 15, 2023 · 1 comment
Open

Feature Request: Option for strict parsing #123

linusclindgren opened this issue Feb 15, 2023 · 1 comment

Comments

@linusclindgren
Copy link

I'd like the option to parse iCals strictly. If this is not the consensus of developers in the project, perhaps the warnings in the ChainingParser could be made public. This way at least it will be possible to see any warnings and throw an exception with the warnings.

abstract class ChainingParser<T extends ChainingParser<?>> {

...

public List<List<ParseWarning>> warnings;
@mangstadt
Copy link
Owner

If you pass an empty list into the "warnings" method of the chaining parser, it will add the parse warnings to the list.

List<List<ParseWarning>> warnings = new ArrayList<List<ParseWarning>>();

ICalendar ical = Biweekly.parse(new File("...")).warnings(warnings).first();

List<ParseWarning> warningsFromFirstICalThatWasParsed = warnings.get(0);
for (ParseWarning warning : warningsFromFirstICalThatWasParsed){
  //...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants