add a test for content of res in the error callback