mrc-ide / rrq

:runner::runner::runner: Lightweight Redis queues
https://mrc-ide.github.io/rrq/
Other
24 stars 4 forks source link

Add richer errors, with nice printing #76

Closed richfitz closed 1 year ago

richfitz commented 1 year ago

This PR updates the way we pass out task errors to make them more useful, and adds a simple format/print message that will guide the user to make the most of them. For example, a failure running a task may now show:

<rrq_task_error>
  from:   f4(x)
  error:  some deep error
  queue:  abc
  task:   123
  status: ERROR
  * To throw this error, use stop() with it
  * This error has a stack trace, use '$trace' to see it
  * This error also has warnings, use '$warnings' to see them

(see the tests for this example). We might update to use cli to print these even more nicely but that probably wants some overall strategy really.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change

Comparison is base (daea82c) 100.00% compared to head (c6463b4) 100.00%.

:exclamation: Current head c6463b4 differs from pull request most recent head 46d4736. Consider uploading reports for the commit 46d4736 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #76 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 26 27 +1 Lines 1694 1718 +24 ========================================= + Hits 1694 1718 +24 ``` | [Impacted Files](https://codecov.io/gh/mrc-ide/rrq/pull/76?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mrc-ide) | Coverage Δ | | |---|---|---| | [R/dependencies.R](https://codecov.io/gh/mrc-ide/rrq/pull/76?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mrc-ide#diff-Ui9kZXBlbmRlbmNpZXMuUg==) | `100.00% <100.00%> (ø)` | | | [R/expression.R](https://codecov.io/gh/mrc-ide/rrq/pull/76?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mrc-ide#diff-Ui9leHByZXNzaW9uLlI=) | `100.00% <100.00%> (ø)` | | | [R/format.R](https://codecov.io/gh/mrc-ide/rrq/pull/76?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mrc-ide#diff-Ui9mb3JtYXQuUg==) | `100.00% <100.00%> (ø)` | | | [R/rrq\_controller.R](https://codecov.io/gh/mrc-ide/rrq/pull/76?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mrc-ide#diff-Ui9ycnFfY29udHJvbGxlci5S) | `100.00% <100.00%> (ø)` | | | [R/task\_cleanup.R](https://codecov.io/gh/mrc-ide/rrq/pull/76?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mrc-ide#diff-Ui90YXNrX2NsZWFudXAuUg==) | `100.00% <100.00%> (ø)` | | | [R/worker\_run.R](https://codecov.io/gh/mrc-ide/rrq/pull/76?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mrc-ide#diff-Ui93b3JrZXJfcnVuLlI=) | `100.00% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mrc-ide). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mrc-ide)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.