Z.py: included error handling in set_res_phase()

Signed-off-by: LK <LK@uni>