Skip to content
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

Fix ENOENT error message in CLI #3165

Merged
merged 10 commits into from Jan 27, 2024
Merged

Fix ENOENT error message in CLI #3165

merged 10 commits into from Jan 27, 2024

Conversation

rzhade3
Copy link
Contributor

@rzhade3 rzhade3 commented Jan 18, 2024

Marked version: 11.1.1

Markdown flavor: n/a

Description

This PR fixes a slight bug in the marked CLI in which the error message due to a ENOENT was bugging out the error output.

I also updated the language in the ENOENT error to better reflect the fact that the ENOENT may have been due to any of the inputted files.

Expectation

When running the marked CLI with an input file that does not exist, I expect it to print out an error containing only the relevant information.

Screenshot 2024-01-18 at 1 58 05 AM

Result

Marked was attempting to print out both error paths, and attempting to print an error object to stderr

Screenshot 2024-01-18 at 1 59 27 AM

What was attempted

The stacktrace above was remediated.

Contributor

  • Test(s) exist to ensure functionality and minimize regression (if no tests added, list tests covering this PR); or,
  • no tests required for this PR.
  • If submitting new feature, it has been documented in the appropriate places.

Committer

In most cases, this should be a different person than the contributor.

Copy link

vercel bot commented Jan 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marked-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 25, 2024 11:09pm

Copy link
Member

@UziTech UziTech left a comment

Choose a reason for hiding this comment

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

Looks like some tests are failing. Can you also add a test for this so there is no regression in the future?

@rzhade3
Copy link
Contributor Author

rzhade3 commented Jan 19, 2024

@UziTech I've fixed the failing tests and attempted to write a test to prevent regressions, but it looked like this part of the code is currently not well tested. I seem to be running into this error whenever I attempt to pass a file as an input to the tests, that I'd appreciate some help debugging:

image

@UziTech
Copy link
Member

UziTech commented Jan 21, 2024

looks like the error was in the bin test framework

bin/main.js Outdated Show resolved Hide resolved
bin/main.js Outdated Show resolved Hide resolved
Co-authored-by: Steven <steven@ceriously.com>
Copy link
Member

@styfle styfle left a comment

Choose a reason for hiding this comment

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

Great, thanks!

@styfle styfle requested a review from UziTech January 26, 2024 23:06
@UziTech UziTech merged commit bf44ae8 into markedjs:master Jan 27, 2024
8 checks passed
github-actions bot pushed a commit that referenced this pull request Jan 27, 2024
# [11.2.0](v11.1.1...v11.2.0) (2024-01-27)

### Bug Fixes

* Fix ENOENT error message in CLI ([#3165](#3165)) ([bf44ae8](bf44ae8))

### Features

* flatten childToken arrays ([#3172](#3172)) ([4826841](4826841))
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.

None yet

6 participants