Skip to content

Commit 898e9ff

Browse files
author
Matt Coley
committed
Add method for removing last error
1 parent 5c2f604 commit 898e9ff

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/main/java/com/hubspot/jinjava/interpret/JinjavaInterpreter.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -650,8 +650,10 @@ public void addError(TemplateError templateError) {
650650
}
651651
}
652652

653-
public TemplateError removeError(int index) {
654-
return errors.remove(index);
653+
public void removeLastError() {
654+
if (!errors.isEmpty()) {
655+
errors.remove(errors.size() - 1);
656+
}
655657
}
656658

657659
public Optional<TemplateError> getLastError() {

0 commit comments

Comments
 (0)