def METHOD_NAME(self, error):
    """Test catching an exception when processing messages."""
    msg = Message(
        topic="org.fedoraproject.prod.buildsys.tag",
        body={}
    )
    consumer = Consumer()
    with mock.patch.object(
        consumer, 'handler_infos',
        [HandlerInfo('.buildsys.tag', 'Automatic Update', mock.Mock())],
    ) as handler_infos:
        with pytest.raises(Nack) as exc:
            handler_infos[0].handler.side_effect = Exception("Something bad happened")
            consumer(msg)
        logmsg = (f"Something bad happened: Unable to handle message in "
                  f"{consumer.handler_infos[-1].name} handler: {msg}")
        error.assert_called_with(logmsg)
        excmsg = ("Unable to (fully) handle message.\nAffected handlers:\n"
                  + "".join(f"\t{hi.name}: Something bad happened\n"
                            for hi in consumer.handler_infos)
                  + "Message:\n{msg}")
        assert str(exc.value) == excmsg