app-center
app-center copied to clipboard
Add (animated?) icon & human readable error message when server is unavailable
Yesterday when the snap store was in maintenance, I got a long error message. Although it's a rare use case, a better user experience would be desirable. If the app can't connect to the server we should show a message like: "Sorry, we can't communicate with the server at the moment - please check back later".
Perhaps with some nice (animated) graphics @Jupi007 ? ๐
What error do you get when the server is unavailable? If it's a specific exception, we can catch it and return a customizable error page @madsrh
It's a rare event but I found it in some of my chats... It's a 403 http response code
frederik@carbon:~/Projects/snapd.dart/example$ dart find.dart skype
Unhandled exception:
SnapdException(kind: null, message: cannot search: got unexpected HTTP status code 403 via GET to "https://api.snapcraft.io/v2/snaps/find?architecture=amd64&channel=stable&confinement=strict%2Cclassic&fields=base%2Cconfinement%2Ccontact%2Cdescription%2Cdownload%2Clicense%2Cprices%2Cprivate%2Cpublisher%2Crevision%2Csummary%2Ctitle%2Ctype%2Cversion%2Cwebsite%2Cstore-url%2Cmedia%2Ccommon-ids%2Cchannel&q=skype")
#0 _SnapdErrorResponse.result (package:snapd/src/snapd_client.dart:905:25)
#1 SnapdClient._getSync (package:snapd/src/snapd_client.dart:1199:26)
<asynchronous suspension>
#2 SnapdClient.find (package:snapd/src/snapd_client.dart:1062:18)
<asynchronous suspension>
#3 main (file:///home/frederik/Projects/snapd.dart/example/find.dart:11:15)
<asynchronous suspension>
frederik@carbon:~/Projects/snapd.dart/example$
403 Forbidden The HTTP 403 Forbidden response status code indicates that the server understands the request but refuses to authorize it.
This status is similar to 401, but for the 403 Forbidden status code, re-authenticating makes no difference. The access is tied to the application logic, such as insufficient rights to a resource.
We could just check if the response is not 200 and then display a nice icon with a text "sorry but we can not reach the store right now". 403 is a bit unintuitive here because one may think that she does something wrong or the application hasn't got any rights anymore
It's a rare event but I found it in some of my chats... It's a 403 http response code
frederik@carbon:~/Projects/snapd.dart/example$ dart find.dart skype Unhandled exception: SnapdException(kind: null, message: cannot search: got unexpected HTTP status code 403 via GET to "https://api.snapcraft.io/v2/snaps/find?architecture=amd64&channel=stable&confinement=strict%2Cclassic&fields=base%2Cconfinement%2Ccontact%2Cdescription%2Cdownload%2Clicense%2Cprices%2Cprivate%2Cpublisher%2Crevision%2Csummary%2Ctitle%2Ctype%2Cversion%2Cwebsite%2Cstore-url%2Cmedia%2Ccommon-ids%2Cchannel&q=skype") #0 _SnapdErrorResponse.result (package:snapd/src/snapd_client.dart:905:25) #1 SnapdClient._getSync (package:snapd/src/snapd_client.dart:1199:26) <asynchronous suspension> #2 SnapdClient.find (package:snapd/src/snapd_client.dart:1062:18) <asynchronous suspension> #3 main (file:///home/frederik/Projects/snapd.dart/example/find.dart:11:15) <asynchronous suspension> frederik@carbon:~/Projects/snapd.dart/example$
Nice! good find.
We could just check if the response is not 200 and then display a nice icon with a text "sorry but we can not reach the store right now". 403 is a bit unintuitive here because one may think that she does something wrong or the application hasn't got any rights anymore
Here's a link to all of the available error status codes. https://snapcraft.io/docs/using-the-api#heading--status-codes A lot of them have different meanings, so idk if bundling them all together is a good idea, especially if we're trying to give the user useful information. We could display the error code as well a "sorry but we can not reach the store right now" message.
@Zoospora @Jupi007
๐ this is the issue for one of the icons you are working one :) Just wanted to give a hint in this ๐ด ๐ ๐ ๐ฒ forest of issues