If you were manually executing the test, what would you do to be able to continue your test?
I click on a button.
I observe that an error message is displayed.
I act on the error.
I continue my test.
Now... translate that into code (the below is pseudo-code intended for illustration)
myApp.buttonOK.Click();
if (myApp.WaitAliasChild('errorWindow', 10000).Exists){
myApp.errorWindow.buttonOK.Click();
}
This is just one example... it's going to depend upon the specifics of your application. Code your test to be "smart", to look for error messages, windows, etc., so they can be handled. However, if they are things that are undesirable (like a duplicate filename, or something like that) then that means you may need to redesign your automation to act differently to avoid those errors... OR, if they are actually bugs in your application... well, report them and have your developers fix them...