client: centralize error reporting