Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need a way to trap errors generated in TADA and prevent them from stopping TADAShiny #179

Open
5 tasks
JamesBisese opened this issue Nov 26, 2024 · 1 comment
Assignees

Comments

@JamesBisese
Copy link
Collaborator

JamesBisese commented Nov 26, 2024

Is your feature request related to a problem? Please describe.

The TADAShiny app should not allow fatal errors to propagate from TADA and cause the app to stop functioning.

Describe the solution you'd like

(This might already be in the code base, but I can't find it yet) There should be a standard try/catch syntax that prevents fatal errors from blocking the web application.

I will try to implement based on https://stackoverflow.com/questions/62997745/trycatch-error-handling-doesnt-work-in-shiny-app

    output$graphChart <- renderPlot({
        
        tryCatch({
            plot(rules())
        }, warning = function(w) {
            showNotification('there was a warning','',type = "error")
            return()
        }, error = function(e) {
            showNotification('there was an error','',type = "error")
            return()
        }, silent=TRUE)
        
    })

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features
you've considered.

Additional context

Building up my understanding of observables - there is no linear trapping of errors. It can be done on the 'TADA' function calls, but it needs to be done such that the observables are reviewed and errors trapped when they are being processed.

Reminders for TADA contributors addressing this issue

New features and/or edits should include the following work:

  • Create or edit the code.

  • Document all code using line/inline and/or multi-line/block comments
    to describe what is does.

  • Create or edit tests in tests/testthat folder to help prevent and/or
    troubleshoot potential future issues.

  • If your code edits impact other functionality in the shiny
    app, ensure those are updated as well.

  • Run styler::style_pkg(), devtools::document(), and devtools::check()
    and address any new notes or issues before creating a pull request.

@JamesBisese JamesBisese self-assigned this Dec 5, 2024
@JamesBisese
Copy link
Collaborator Author

This needs both a general solution, and then ad-hoc implementation. Users should only see one metaphor when they encounter fatal errors.

  1. Create acceptable 'Error' modal using existing libraries
  2. figure out trapping mechanics to populate the error message
  3. determine how and when to backup from the error and allow the user to continue, vs reset the session and have users restart
  4. implement the error handling on specific points (like Upload Dataset and Upload Progress File)
    LOE: 40 hours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants