Skip to content

Conversation

Prathamesh0901
Copy link
Contributor

Resolves #[Issue Number if there]

PR Fixes:

Checklist before requesting a review

  • I have pull latest changes from main branch
  • I have tested the changes locally
  • I have run npm run lint:fix locally
  • I have performed a self-review of my code
  • I assure there is no similar/duplicate pull request regarding same issue

Currently, 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

image

Modified

image

Copy link

vercel bot commented Oct 11, 2025

@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.

Copy link

vercel bot commented Oct 12, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
custom-code-editor Ready Ready Preview Comment Oct 15, 2025 7:47am

@DhanushNehru DhanushNehru requested a review from Copilot October 12, 2025 18:09
Copy link
Contributor

@Copilot 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 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.

Copy link
Contributor

@Copilot 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

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) => {
Copy link

Copilot AI Oct 15, 2025

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.

Suggested change
const decodeFormat = (data) => {
const decodeBase64Output = (data) => {

Copilot uses AI. Check for mistakes.

Comment on lines +200 to +202
setOutput(decodeFormat(data.stderr));
} else if (data.compile_output) {
setOutput(decodeFormat(data.compile_output));
Copy link

Copilot AI Oct 15, 2025

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.

Suggested change
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.

@DhanushNehru DhanushNehru merged commit 0f0701b into DhanushNehru:main Oct 15, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants