I uses a SQL Job which call the Python Script.. In some scenario I want to exit out of script without failing the job completely, but just by throwing some message. The SQL job has 3 steps such as 1. PreProcess 2. Process 3. PostProcess.. So In some situation, want to exit out of PreProcess but still want to process PostProcess.. Below is my class structure.
class Test:
def pre_process():
#some code
sys.exit("exiting out of program")
def process():
#some code
def post_process():
#some code
def run():
try:
pre_process()
process()
except Exception as e:
raise e
finally:
post_process()
So the issue here is the code is exiting out but with error. But want to exit out of the program successfully. Any suggestion is helpful!