downlit icon indicating copy to clipboard operation
downlit copied to clipboard

fail gracefully if packages cannot be referenced

Open GregorDeCillia opened this issue 1 year ago • 0 comments

When using {packagename}, downlit tries to autolink the package using several heuristics. This sometimes fails if either the heuristics are not capable of discovering the package or (much more likely) if there is a typo in the package name. I currently get very obscure error messages when this happens.

For example, I had a typo in the yaml metadata in one of my articles (vignettes/database.Rmd)

title: "Database Stuff"
description: "Instruction for using the `{RSQLiteTYPO}` database"

When trying to render the articles index, this shows the following error

pkgdown::build_articles_index()
#> Error in readRDS(con) : 
#>   embedded nul in string: '\ndoParal\001pes (>=lurviqiter\004\0\t\0\0\0!'

It would be very useful if this could be replaced by something like this

pkgdown::build_articles_index()
#> Error: unable to link to package 'RSQLiteTYPO'

GregorDeCillia avatar Oct 16 '22 15:10 GregorDeCillia