src: CancelTerminateExecution before throwing errors
Terminating the execution of a script would create a pending exception, therefore we should cancel the termination before throwing a new exception, otherwise the attempt to create a custom error may fail.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines