Generate error responses taking into account the message fields.
`