Introduce pattern for sending error messages to client