Add test for handling errors in debug callbacks