Improve tnt error handling