Skip to content

Debugging and error handling #880

@rezasz969

Description

@rezasz969

Hi there,
I wrote a shiny web app and this app get a table from the database with an ID, but when I importing a ID does not exist in the data, it gives an error. I fixed this error with the tryCatch function. But this function does not work in Golem architecture and The whole app crashes and closes. how can I handling an error in golem?

A part of my code:

output$data <- renderDT({
      tryCatch({
      DT::datatable(r$data, rownames = F,
                    options = list(scrollX = T, fixedHeader = T,
                                   columnDefs = list(list(className = 'dt-center', targets = '_all'))))
      }, error = function(w) {
        shinyalert("Error!", w$message, type = "error")
        return()
      })
    })

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions