Raise exception if a script fails