Reduce error handling boilerplate