...I have a Shiny application that connects to Oracle database with ODBC protocol.
I want to make a nice error notification if a bad query has been passed to DB.
After establishing connection, I pass a query to dbGetQuery(pool,v_query) and use tryCatch() to process result.
here is my 'error' function:
error=function(e) {
showModal(modalDialog(
title = "Query Failed",
tags$b("Error:"), br(),
tags$code(conditionMessage(e))
))
cat(conditionMessage(e))
})
while cat() generates a readable text, in modal dialog window I see a string full of escape characters.
Here is patrial cat() output:
Evaluation error: ! ODBC failed with error 00000 from [Oracle][ODBC][Ora].
✖ ORA-00942: table or view does not exist
•
• <SQL> 'SELECT
Here is the partial output from tags$code(conditionMessage(e)):
Evaluation error: e[38;5;232me[33m!e[38;5;232m ODBC failed with error 00000 from e[32m[Oracle][ODBC][Ora]e[38;5;232m. e[31m✖e[38;5;232m ORA-00942: table or view does not exist e[36m•e[38;5;232m e[36m•e[38;5;232m <SQL> 'SELECT
I tried to use textOutput(conditionMessage(e) but application crashes with the error:
No handler registered for type .clientdata_output_Evaluation error: ! ODBC failed with error 00000...
Is there a simple way to display error output in modalDialog with correct formatting?