Centralized error logic
adds commit and finish method