Add spec tests for capturing response on error