api: Centralize error management
api: Centralize error management

We handle 'GET' and 'PATCH' errors in the same way. De-dupe the
respective functions to show this.

Signed-off-by: Stephen Finucane <06fa905d7f2aaced6dc72e9511c71a2a51e8aead@that.guru>

stephenfin/git-pw,getpatchwork/git-pw