Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Parsing Error with try-catch #44

Closed
pbashyal-nmdp opened this issue May 21, 2015 · 2 comments
Closed

Parsing Error with try-catch #44

pbashyal-nmdp opened this issue May 21, 2015 · 2 comments

Comments

@pbashyal-nmdp
Copy link

When using tidy_app() with the following R code

  resultJSON <- NULL
  tryCatch(
    # Get Result from the server
    resultJSON <- RCurl::getURL(url, httpheader= httpHeaders),
    error = function(e) {
      message(paste("Failed calling the service at URL", url))
    }

  )

I get the following error

> formatR::tidy_app()

Listening on http://127.0.0.1:3380
Error in base::parse(text = code, srcfile = NULL) : 
  4:1: unexpected symbol
3: invisible(".BeGiN_TiDy_IdEnTiFiEr_HaHaHa# Get Result from the server.HaHaHa_EnD_TiDy_IdEnTiFiEr")
4: resultJSON
   ^

Here's my sessionInfo:

> sessionInfo()
R version 3.2.0 (2015-04-16)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.9.5 (Mavericks)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] formatR_1.2  shiny_0.12.0

loaded via a namespace (and not attached):
 [1] R6_2.0.1         htmltools_0.2.6  tools_3.2.0      rstudioapi_0.3.1 Rcpp_0.11.5      jsonlite_0.9.16  digest_0.6.8     xtable_1.7-4    
 [9] httpuv_1.3.2     mime_0.3        
> 
@yihui
Copy link
Owner

yihui commented May 22, 2015

formatR does not work for all R code. Please see Section 6: http://yihui.name/formatR

@pbashyal-nmdp
Copy link
Author

Thanks. I modified my code to work better with formatR.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants