allow configuration of the error middleware in batteries