Improved error reporting for transformers