fix(decorators): Gracefully Handle File Read Errors#53
Merged
jourdain merged 5 commits intoKitware:masterfrom Mar 24, 2026
Merged
fix(decorators): Gracefully Handle File Read Errors#53jourdain merged 5 commits intoKitware:masterfrom
File Read Errors#53jourdain merged 5 commits intoKitware:masterfrom
Conversation
Used so files with read errors don't halt execution, instead are handled gracefully and submitted to the server
Collaborator
|
It would be great to update fileHandler in js-lib too. This seems great! |
Contributor
Author
|
I accidentally had Actions running on my fork, I think that's what caused 934784c to occur. I've reverted it now |
Collaborator
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR makes the
fileHandlerdecorator handle errors thatFileobjects throw if theircontentis unreadable due to permission errors. This can occur if the browser submits multiple files to Trame and one of them is unreadable, resulting in a JS error being thrown to the console. This modifies thefileHandlercode to append a new key to the object,error, containing the error message reported from theFileReaderobject. That way, the server code can read this per-file and deduce which files had an error while uploading.I do notice that there's another fileHandler in js-lib, is this to be updated as well?
Demo
Below is an example of how a consumer may use this new
errorfield on the serializedFiledictionaries from the client. In this, the callback forupdate_modelValuewill always run despite any errors processing the files, that way the ones that uploaded without errors can still be processed while also being able to annotate which files weren't able to be processed due to errors while uploading.Closes #51