Adding test for sending an error