Better error handling in ACE callback