RBIEN icon indicating copy to clipboard operation
RBIEN copied to clipboard

Return error message if connection is being blocked

Open bmaitner opened this issue 8 years ago • 2 comments

It would be useful to have the internal function BIEN_sql return a specific and easily understood error message if the package cannot connect to the database.

bmaitner avatar Aug 15 '17 20:08 bmaitner

Cool package! was just trying to explore a bit and I got this error message:

> BIEN_plot_country(c("Costa Rica","Panama"))
Error in postgresqlNewConnection(drv, ...) : 
  RS-DBI driver: (could not connect [email protected]:5432 on dbname "public_vegbien": could not connect to server: Connection refused
	Is the server running on host "vegbiendev.nceas.ucsb.edu" (128.111.84.31) and accepting
	TCP/IP connections on port 5432?
)

Any idea if the database connection issue is specific to me? firewall of some kind? I can access http://vegbiendev.nceas.ucsb.edu/

R version 3.4.2 (2017-09-28)

other attached packages:
[1] BIEN_1.2.2        RPostgreSQL_0.6-2 DBI_0.7   

wcornwell avatar Jan 09 '18 08:01 wcornwell

I discovered the package today and tried this as well. vignette("BIEN") states

Database connection issues

Some institution and computer programs (e.g. some antivirus programs) block the SQL connections that this package relies on. While we are exploring ways around this issue, at present the simplest method is to use the package on a computer/network that doesn’t block SQL connections.

mcgregorian1 avatar Dec 07 '18 19:12 mcgregorian1