Skip to content

Commit

Permalink
Added support for suppressed invalid properties when parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
benfortuna committed Jan 5, 2023
1 parent e4c169a commit 5714aa2
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -4,6 +4,7 @@
import net.fortuna.ical4j.model.component.CalendarComponent;
import net.fortuna.ical4j.model.component.VTimeZone;
import net.fortuna.ical4j.util.Constants;
import org.slf4j.LoggerFactory;

import java.time.zone.ZoneRulesProvider;
import java.util.ArrayList;
Expand Down Expand Up @@ -148,9 +149,9 @@ public void endProperty(String name) {
Property property;
try {
property = propertyBuilder.build();
} catch (URISyntaxException | ParseException | IOException e) {
} catch (RuntimeException e) {
if (context.isSupressInvalidProperties()) {
LOG.warn("Suppressing invalid property", e);
LoggerFactory.getLogger(DefaultContentHandler.class).warn("Suppressing invalid property", e);
return;
} else {
throw e;
Expand Down

0 comments on commit 5714aa2

Please sign in to comment.