library(RSQLite)
conn <- dbConnect(dbDriver("SQLite"), dbname="test.db")
tryCatch(
	data <- dbGetQuery(conn, "SELECT MAX(gears) FROM mtcars"),
	error=function(e) {
		print(e)
		print("Error caught")
	}
)
dbGetException(conn)
dbDisconnect(conn)
