Replaced the sys.exit in the try-except blocks with raise so that the python call stack will be printed