Script stops on db connection error