title: How to request an early exit when knitting an Rmd document?
body: <p>Let's say you have an R markdown document that will not render cleanly.</p>
  
  <p>I know you can set the <code>knitr</code> chunk option <code>error</code> to <code>TRUE</code> to request that evaluation continue, even in the presence of errors. You can do this for an individual chunk via <code>error = TRUE</code> or in a more global way via <code>knitr::opts_chunk$set(error = TRUE)</code>.</p>
  
  <p>But sometimes there are errors that are still fatal to the knitting process. Two examples I've recently encountered: trying to <code>unlink()</code> the current working directory (oops!) and calling <code>rstudioapi::getVersion()</code> from inline R code when RStudio is not available. Is there a general description of these sorts of errors, i.e. the ones beyond the reach of <code>error = TRUE</code>? Is there a way to tolerate errors in inline R code vs in chunks?</p>
  
  <p>Also, are there more official ways to halt knitting early or to automate debugging in this situation?</p>