fix: viewing folder without permissions shows error message #237
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Clickup id: 86acyvgzc
@krokicki @neomorphic
Restores how permission errors are handled and displayed in the file browser UI by removing the
throwOnError: trueglobal setting in the Tanstack Query Client. This was overring the query-specific error handling. Also fixes how the error is passed through the query, since passing both an error and data causes Tanstack Query dev tools to show errors in the dev console. Now, only data, no error, is passed.Permission error handling improvements:
useFileQueryhook now returns partial data with anerrorMessagewhen a permission error (403) occurs, instead of throwing an error. This enables the UI to display folder information and a permission error message together. [1] [2]Query client configuration:
throwOnErroroption was removed from the React Query client configuration, since errors are now handled and displayed directly in the UI rather than being thrown to error boundaries.