Usually you need to expect an error to use
:do {} on-error {}
so that you can handle that error which will not break code execution (same as try-catch statement in some programming languages). It is better to write more strict code as rextended mentioned above with conditions to avoid errors in first place if you have code flow that needs to be mandatory, since having just logging in on-error block will not describe which error is actually occurred because there is no some error variable (afaik) in that block which will contain error message (but it would be nice that scripting engine provides that). When you have optional code execution in flow then
:do {} on-error {}
makes sense.