Script run in another script

If I run one script in another script, the first main script stops working if there are syntax errors in the second script. But then how can I check whether the script has run successfully or not, if the script through which I run another script also stops working in case of failure

Just write the scripts correctly, as it should be done, that is, the script itself must prevent errors.

This reminds me of the monty python sketch, “the lost world of Roiurama” but the best part of the skit is… who is filming us now??

https://www.youtube.com/watch?v=rX2rHJg30xA

I agree on above replies, but to answer OP question

:do {
  /system/script/run script-with-syntax-errors
} on-error={
  :put "script run error"
}

P.S.
Not related to this topic, my favorite MP scene which always comes to my mind on my job when incompetent people defines how something works https://www.youtube.com/watch?v=H9PY_3E3h2c