Testing the error handling in callback