Skip to content

feat: user friendly error messages - #267

Open
mpivchev wants to merge 11 commits into
mainfrom
friendly-errors
Open

mpivchev wants to merge 11 commits into
mainfrom
friendly-errors

Conversation

@mpivchev

@mpivchev mpivchev commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Removes technical server error strings with more appropriate (and generic) user readable strings. NKLog still prints the proper server errors.

Ex: 507: Storage quota is reached becomes There is not enough storage space left on the server. etc.

What changes

  • NKError.kind: Classifies between URL errors, HTTP statuses, OCS codes and the WebDAV InvalidPath exception.
  • NKError.localizedGenericMessage: one translated message per kind. Only exception is unified sharing API, which prints user friendly messages from server.

Related: nextcloud/ios#4397 (TLDR: also adds contexts to degeneralize kind errors, ex: Could not delete Report.pdf and is iOS Files specific)
Blocked by: nextcloud/docker-ci#1011

Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
…NextcloudKit

Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
@mpivchev
mpivchev marked this pull request as ready for review October 20, 2026 14:03
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
@marinofaggiana

Copy link
Copy Markdown
Member

The overall approach looks good, and separating technical error descriptions from user-facing messages is a welcome improvement.

However, I have a couple of concerns about the HTTP status classification:

  • 412 on MOVE/COPY: A precondition failure does not necessarily mean that the destination already exists. It may also be caused by other failed HTTP preconditions, such as ETag validation.
  • 405 on MKCOL: While this commonly indicates an existing resource in WebDAV, it should not automatically be interpreted as a name conflict in every situation.
  • 409 Conflict: The generic message suggesting that the item was changed on the server may be misleading for conflicts caused by other conditions.

I would also recommend checking existing Nextcloud iOS consumers of errorDescription, since it is no longer guaranteed to contain a localized user-facing message.

I think the architecture is sound, but these classifications should be refined before merging.

@marinofaggiana marinofaggiana left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

read consideration

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants