[packaging] Better error handling