-
-
Notifications
You must be signed in to change notification settings - Fork 59
[fixes issue 201]: added errors in output #203
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
Conversation
@Prathamesh0901 is attempting to deploy a commit to the Dhanush Nehru's projects Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Pull Request Overview
This PR enhances error handling in the code editor by displaying compilation and runtime errors from the Judge0 API in the output section instead of only showing a generic snackbar notification.
- Added a utility function to decode and format error messages from the Judge0 API
- Enhanced error handling to display stderr and compile_output errors in the output section
- Refactored stdout processing to use the new decoding utility function
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
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.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
fontWeight: "bold", | ||
})); | ||
|
||
const decodeFormat = (data) => { |
Copilot
AI
Oct 15, 2025
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.
The function name decodeFormat
is ambiguous. Consider renaming it to decodeBase64Output
or parseBase64Response
to clearly indicate it decodes base64-encoded data and formats it as an array of lines.
const decodeFormat = (data) => { | |
const decodeBase64Output = (data) => { |
Copilot uses AI. Check for mistakes.
setOutput(decodeFormat(data.stderr)); | ||
} else if (data.compile_output) { | ||
setOutput(decodeFormat(data.compile_output)); |
Copilot
AI
Oct 15, 2025
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.
[nitpick] Consider combining both error conditions to avoid duplication. You could use setOutput(decodeFormat(data.stderr || data.compile_output))
since both handle error scenarios similarly.
setOutput(decodeFormat(data.stderr)); | |
} else if (data.compile_output) { | |
setOutput(decodeFormat(data.compile_output)); | |
setOutput(decodeFormat(data.stderr || data.compile_output)); |
Copilot uses AI. Check for mistakes.
Resolves #[Issue Number if there]
PR Fixes:
Checklist before requesting a review
main
branchnpm run lint:fix
locallyCurrently, there are no compilation or output errors shown in the editor. The only thing is a snackbar which is generic, the judge0 api provides compilation or any errors in the api, I have added them in the output section.
Current
Modified