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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle errors happen during streaming components #1648
Handle errors happen during streaming components #1648
Changes from 3 commits
50bf32f
2ec583e
ad9b93c
2b111e3
cc05983
b2af578
63cc100
e7e3857
3b7728a
276ac40
880f10e
721fed8
f36d74d
1507a9a
8f2e0b3
902e581
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Consider improving readability of error condition checks.
The boolean logic could be more readable by extracting conditions into well-named variables.
Consider this refactor:
📝 Committable suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Enhance error handling and add documentation for Pro configuration retrieval.
The method silently returns nil for non-Pro installations and might not handle missing configuration keys in ReactOnRailsPro gracefully. Consider:
📝 Committable suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Refactor 'stringToStream' using 'Readable.from'
You can simplify the
stringToStream
function by utilizingReadable.from
, which is available in Node.js v12 and above. This approach makes the code more concise and leverages built-in stream utilities.Apply this diff:
📝 Committable suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure 'console.history' is available
console.history
may not be defined in all environments. To prevent potential runtime errors, consider providing a default value when it's undefined.Apply this diff:
📝 Committable suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handle errors in 'onError' callback consistently
In the
onError
callback, the error is currently not being handled or communicated to the client. To ensure consistent error handling, consider processing the error similarly toonShellError
.Apply this diff:
This ensures that errors encountered during rendering are properly relayed to the client.