Below is the part of my server code. Actually there is an error in SQL for some conditions. So when I execute in R calling SQL, the R shiny crashes. So i tried putting trycatch()
. Even then the app crashes but I can see notifications when app crashes. Please anyone help
if(input$ID != "" && !is.null(input$Date)){
# to get data from SQL
tryCatch({
# to get data from SQL
sql <- paste0("SELECT * FROM [SSS].[AAA].[CCC]")
df1 <- sqlQuery(db, sql) # db is already declared
},
error = function(err){
showNotification(paste0(err), type = 'err')
})