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

Tweak error messaging #2198

Merged
merged 5 commits into from
Dec 22, 2022
Merged

Tweak error messaging #2198

merged 5 commits into from
Dec 22, 2022

Conversation

rich-iannone
Copy link
Collaborator

@rich-iannone rich-iannone commented Nov 22, 2022

This PR makes a few tweaks to the error messaging formatting.

The error obtained from knitr::knit(text = "`r 1 + `", quiet = TRUE) was

knitr::knit(text = "`r 1 + `", quiet = TRUE)
#> Quitting from lines 1-1 ()
#> Error: Failed to parse the inline R code: 1 +  (Reason: <text>:2:0: unexpected end of input
#> 1: 1 + 
#>    ^)

And this PR changes it to:

#> Error: Failed to parse the inline R code: `1 + `
#> Reason: <text>:2:0: unexpected end of input
#> 1: 1 + 
#>    ^

I removed the first line of error output but it might be good to keep it in revised form (with the filename only?) or unchanged. Let me know and I could revise accordingly.

Fixes: #2173

@rich-iannone rich-iannone marked this pull request as ready for review November 22, 2022 19:23
@rich-iannone
Copy link
Collaborator Author

Note to self: restore error message in output.R.

rich-iannone and others added 4 commits December 22, 2022 08:50
* master:
  make negative times 0
  replace highr:::spaces() with strrep() in base R
  support chunk options message/warning = NA
  close #2204: drop the support for cairoDevice
  amend 1a0f2cc: make line_count() a few times faster
  Replace several stringr-based function calls with base equivalents (#2202, #1549)
  see if this fix the ruby gems issue https://github.com/yihui/knitr/actions/runs/3682745993/jobs/6230638404
  stop importing xfun::isFALSE() and define isFALSE() only for R < 3.5.0
  Add labels to the default progress bar and allow users to provide a custom progress bar (#2196)
Copy link
Owner

@yihui yihui left a comment

Choose a reason for hiding this comment

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

Thanks!

@yihui yihui merged commit 973ed84 into master Dec 22, 2022
@yihui yihui deleted the error-formatting-enhance branch December 22, 2022 20:27
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hard to parse inline parsing error
2 participants