Skip to content

Commit 512286e

Browse files
authored
Merge pull request #696 from HubSpot/add-api-remove
Add method for removing last error
2 parents d9933c3 + 898e9ff commit 512286e

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)