online-accounts: Doesn't report the GError (if any) when adding a new account
Some time ago while updating the UI of the Online Accounts panel, we forgot to retain the code (see the goa_panel_add_account_dialog_get_account
call) that reported errors, if any, when adding a new account.
Since this is about error handling, and we might not be able to reproduce the error in future, here are some specifics of the particular error I hit.
My attempt to add a Foursquare account hit a HTTP 429 error inside rest_proxy_call_sync
. Here is the relevant code.
Here's the HTTP response received over the wire:
< HTTP/1.1 429 Too Many Requests
< Soup-Debug-Timestamp: 1618947374
< Soup-Debug: SoupMessage 1 (0x559acd59e550)
< Connection: keep-alive
< Content-Length: 134
< Server: nginx
< Content-Type: application/json; charset=utf-8
< Tracer-Time: 4
< X-RateLimit-Path: /v2/users/X
< X-RateLimit-Limit: 0
< X-RateLimit-Remaining: 0
< Access-Control-Allow-Origin: *
< Accept-Ranges: bytes
< Date: Tue, 20 Apr 2021 19:36:14 GMT
< Via: 1.1 varnish
< X-Served-By: cache-vie21649-VIE
< X-Cache: MISS
< X-Cache-Hits: 0
<
< {"meta":{"code":429,"errorType":"quota_exceeded","errorDetail":"Quota exceeded","requestId":"607f2d2ee67ee12381ab3bff"},"response":{}}
This gets represented by a GError
whose domain is REST_PROXY_ERROR
, the code is 429
and the message is Error getting identity: Too many requests
.
The message of the GError
is already somewhat sanitized to be shown to the user. We just need to show it somehow. :)