Do a particular action at any point if error occurs

Hi All

is there a way to have a particular step be taken if an error occurs anywhere with the macro? In my case, I want it to log out of the website if an error occurs midway, in the beginning, etc so that next time it runs it starts from the same location.

the reason behind this is that I have setup a process which looks for 10 instances on each page for a particular element, across three pages, but not all the accounts I log into would have 10 per page, might have 10 on page one, then 3 on page 2, but the process is told to look for 10 on each page so a error occurs eventually.

Nevermind figured it out with the store true errorignore function, it then runs all the way through my macro till the end where it logs out