improved error messages and YAML emit fails