ERROR TRAPPING is an important part of scripting in FileMaker–and not just to keep users from landing where they shouldn’t. Dwayne Wright shows the basics of error capture, which you can use as a model to test for any error or a specific error:
Part of the solution to reacting to a variety of errors is to trap for no errors. If[ status (CurrentError) <> 0] is a typical way to do this. The Status(CurrentError) function returns a zero when no errors are encountered. So Status(CurrentError) <> 0 means we are looking for instances where the function did not return a 0. This means it returned an error and we want our script to react to any error.