Sometimes I some program spits out an error message, but it shows it only for a really short moment so that I can't read it, but I can reproduce it easily. Is there some simple way of capturing it e.g. using some screenshot tool and telling it to snap quickly 10 times within the next second, without using some sort of video recording?
sudo apt-get install recordmydesktop
will install recordmydesktop a decade old app to do what you describe.
Ctrl+R starts it and
Ctrl+LeftAlt+S stops it
Its Performance tab determines how many frames per second you wish recorded.