BATCH-1189: By default, all exceptions should be fatal

This commit is contained in:
dhgarrette
2009-04-01 21:22:43 +00:00
parent 3f7f2d8b4e
commit 3dc92be2ed
8 changed files with 132 additions and 43 deletions

View File

@@ -27,6 +27,7 @@ import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.item.ItemStreamException;
import org.springframework.batch.item.ItemStreamSupport;
import org.springframework.batch.item.ItemWriter;
import org.springframework.batch.item.WriteFailedException;
import org.springframework.batch.sample.domain.trade.Trade;
import org.springframework.batch.sample.domain.trade.TradeDao;
import org.springframework.util.Assert;
@@ -58,7 +59,7 @@ public class TradeWriter extends ItemStreamSupport implements ItemWriter<Trade>
Assert.notNull(trade.getPrice()); // There must be a price to total
if (this.failingCustomers.contains(trade.getCustomer())) {
throw new RuntimeException("Something unexpected happened!");
throw new WriteFailedException("Something unexpected happened!");
}
}