owncloud / moodle-repository_ocis

GNU General Public License v3.0
3 stars 0 forks source link

improve user facing error reporting #40

Closed individual-it closed 11 months ago

individual-it commented 11 months ago

Catch the most likely issues and show a better message to the user.

fixes #39

depends on https://github.com/owncloud/ocis-php-sdk/pull/125

If the debugging options are disabled this looks like this e.g. when a folder disappears: image

And like that with enabled debug settings: image

Do we need to catch more cases?

PhMemmel commented 11 months ago

Typical errors would also be that the server is not reachable (see #36) or the authentication did not succeed (token expired, access denied).

In addition to that, error code 500 should maybe displayed to the user as "The server has an internal problem. Please try again later." to clarify that it's not the users fault what happened here.

Also: After displaying the exception the user just as a blank filepicker window and does not know what to do. So there has some mechanism to make the user reload the file picker, display a button to try a reload in the listing area of the file picker or anything else.

individual-it commented 11 months ago

@PhMemmel thank you for the feedback. I've added more exception handling:

  1. Server not reachable should be handled by HttpException
  2. Internal server error (500) is also handled now - but the change still needs review in https://github.com/owncloud/ocis-php-sdk/pull/125
  3. Issues with Authentication will be handled by UnauthorizedException
  4. When trying to download a file that is still processed on the ocis server I've added TooEarlyException. Alternatively we could not display those files

I'm not quite sure how to help the user better after the error message. The user can click on any of the breadcrumbs or the repository button

https://github.com/owncloud/moodle-repository_ocis/assets/2425577/3575b037-d894-4752-be0e-d626966ef018

PhMemmel commented 11 months ago

Looks great, thank you very much! Also the reload button is very valuable for the user.