Handle exceptions with retrying while posting data