Skip to content

V16 RC: File upload errors should be shown to the user#19344

Merged
leekelleher merged 1 commit intorelease/16.0from
v16/bugfix/error-message-on-fileupload
May 19, 2025
Merged

V16 RC: File upload errors should be shown to the user#19344
leekelleher merged 1 commit intorelease/16.0from
v16/bugfix/error-message-on-fileupload

Conversation

@iOvergaard
Copy link
Copy Markdown
Contributor

@iOvergaard iOvergaard commented May 16, 2025

Description

This pull request refines error handling in the UmbTemporaryFileManager class to improve robustness and user feedback. The key change is the introduction of a more structured check for UmbApiError instances and the addition of a fallback notification mechanism for unhandled server errors.

Error handling improvements:

image

Copilot AI review requested due to automatic review settings May 16, 2025 13:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances error handling in UmbTemporaryFileManager by replacing the instanceof check with a static type guard and ensuring all server errors surface a user notification.

  • Use UmbApiError.isUmbApiError for safer type checking.
  • Add a fallback notification for non-413 UmbApiError statuses.
Comments suppressed due to low confidence (1)

src/Umbraco.Web.UI.Client/src/packages/core/temporary-file/temporary-file-manager.class.ts:191

  • There are no tests covering the new fallback notification path for non-413 UmbApiError statuses. Consider adding a unit test to verify that #notificationContext.peek is called with the expected error details when an unexpected server error occurs.
if (UmbApiError.isUmbApiError(error)) {

@leekelleher leekelleher merged commit 8f17156 into release/16.0 May 19, 2025
24 checks passed
@leekelleher leekelleher deleted the v16/bugfix/error-message-on-fileupload branch May 19, 2025 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants