[client-backup] extract code to handle HTTP error
Summary:
Reducing code duplication.
Depends on D8996
Test Plan: flow
Reviewers: michal, marcin, bartek
Reviewed By: bartek
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D8997