[fix] check trailers to correctly output an error and replicate how errors output themselves