Adding content length and type to error message