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

Quote problematic embed-code command when error occurs #18

Open
alexander-yevsyukov opened this issue Jul 31, 2020 · 0 comments
Open

Quote problematic embed-code command when error occurs #18

alexander-yevsyukov opened this issue Jul 31, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@alexander-yevsyukov
Copy link
Collaborator

Currently, when code embedding fails because it's not possible for find a matching start or end line specified in a command, we got an error which looks like this:

jekyll 3.8.7 | Error:  There is no line matching `Pattern satic {`.
/Users/sanders/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/bundler/gems/embed-code-eb18b3b9c6c5/lib/commands/embedding_instruction.rb:106:in `match_glob': There is no line matching `Pattern satic {`. (RuntimeError)
        from /Users/sanders/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/bundler/gems/embed-code-eb18b3b9c6c5/lib/commands/embedding_instruction.rb:89:in `matching_lines'
        from /Users/sanders/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/bundler/gems/embed-code-eb18b3b9c6c5/lib/commands/embedding_instruction.rb:80:in `content'
        from /Users/sanders/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/bundler/gems/embed-code-eb18b3b9c6c5/lib/commands/embedding.rb:254:in `render_sample'
...

The cause of the error is that I made a mistake in the word static. But information provided in the error message is not enough for quickly finding a problematic command.

As a minimum, we need to give:

  1. The name of the file where the error occurred.
  2. Line number with the error.

It would be good to have a column number where the error occurred.

Ideally, it would be good:

  • display the whole command which failed;
  • highlight with red color the problematic string when printing to the screen console, and point with ^ when writing to a text file.
@alexander-yevsyukov alexander-yevsyukov added the enhancement New feature or request label Jul 31, 2020
@dmdashenkov dmdashenkov removed their assignment Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants