Skip to content

Comments

feat: record Javascript error types#565

Open
a2937 wants to merge 4 commits intofreeCodeCamp:mainfrom
a2937:feat/grab-javascript-error-names
Open

feat: record Javascript error types#565
a2937 wants to merge 4 commits intofreeCodeCamp:mainfrom
a2937:feat/grab-javascript-error-names

Conversation

@a2937
Copy link
Member

@a2937 a2937 commented Feb 9, 2026

Checklist:

Closes #XXXXX

This PR might need some internal discussion but I wanted to record the error type for JavaScript lessons as well for potential future error messages.

@a2937 a2937 requested a review from a team as a code owner February 9, 2026 18:04
@a2937 a2937 added the blocked This pull-request can not yet be merged label Feb 10, 2026
@a2937
Copy link
Member Author

a2937 commented Feb 10, 2026

Oh I also forgot to update the tests.

Copy link
Contributor

@ojeytonwilliams ojeytonwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @a2937, this seems like a good thing to add. Could you write a test to lock this down? It would help to have a test so people can see the use-case.

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
@a2937
Copy link
Member Author

a2937 commented Feb 10, 2026

The way the tests are written with a describe.each; it makes it really difficult to test.

@a2937
Copy link
Member Author

a2937 commented Feb 10, 2026

Unless I maybe try updating the Python evaluator too?

@ojeytonwilliams
Copy link
Contributor

It's a bit of a hassle, sure, but I'm trying to keep things as consistent as possible. That said, there are some differences between the evaluators and there are some tests that only care about specific ones.

Maybe if you describe the use case I can help? Either way, don't worry about all the failing tests until we have new tests for the new functionality.

@a2937
Copy link
Member Author

a2937 commented Feb 10, 2026

I wanna be able to display some kind of help message in the console to campers based on what kind of unexpected error they received. Like to explain what a reference error is and how to fix it; along with the standard information that a failed test gives you.

@ojeytonwilliams
Copy link
Contributor

I see, thanks. The issue is that tests can throw errors and it would be confusing if we started explaining those errors to campers. After all, they're not expected to see test code.

Perhaps if runTest returned some extra information (an isEvaluationError property, say) alongside the error so the consumer could tell where the error came from?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked This pull-request can not yet be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants