Component for serializing errors into JSON objects