-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploying to gh-pages from @ 5d4f0e0 🚀
- Loading branch information
1 parent
ccddeb7
commit 95abaea
Showing
12 changed files
with
4 additions
and
3 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[{"path":"https://slap.tada.science/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 tada.science Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://slap.tada.science/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Romain François. Author, maintainer. tada.science. Copyright holder, funder.","code":""},{"path":"https://slap.tada.science/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"François R (2024). slap: Simplified Error Handling. R package version 2024.4.1, https://slap.tada.science, https://github.com/tadascience/slap.","code":"@Manual{, title = {slap: Simplified Error Handling}, author = {Romain François}, year = {2024}, note = {R package version 2024.4.1, https://slap.tada.science}, url = {https://github.com/tadascience/slap}, }"},{"path":"https://slap.tada.science/index.html","id":"slap-","dir":"","previous_headings":"","what":"Simplified Error Handling","title":"Simplified Error Handling","text":"goal slap simplify error handling.","code":""},{"path":"https://slap.tada.science/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Simplified Error Handling","text":"","code":"pak::pak(\"tadascience/slap\")"},{"path":"https://slap.tada.science/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"Simplified Error Handling","text":"","code":"library(dplyr) library(slap) # suppose you have a function that throws an error boom <- function() stop(\"An error occured in boom()\") # and you want to use it in e.g. dplyr::summarise() # summarise(mtcars, mpg = boom()) # if you want to catch it and rethrow an error that is more # meaningful to you, one way is to use withCallingHandlers() withCallingHandlers( summarise(mtcars, mpg = boom()), error = function(err) { cli::cli_abort(\"ouch\", parent = err) } ) # but that's kind of boring, so instead you can use the # slap operator %!% to slap away the eror summarise(mtcars, mpg = boom()) %!% \"ouch\" # or the double slap operator %!!% if you don't want to keep the parent error summarise(mtcars, mpg = boom()) %!!% \"ouch\""},{"path":"https://slap.tada.science/reference/slap.html","id":null,"dir":"Reference","previous_headings":"","what":"Slap Operator — slap","title":"Slap Operator — slap","text":"Slap Operator","code":""},{"path":"https://slap.tada.science/reference/slap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Slap Operator — slap","text":"","code":"expr %!% message expr %!!% message"},{"path":"https://slap.tada.science/reference/slap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Slap Operator — slap","text":"expr expression quosure evaluate carefully message message meant formatted cli::cli_bullets() function.","code":""},{"path":"https://slap.tada.science/reference/slap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Slap Operator — slap","text":"expr succeeds, result returned. expr generates error, %!% %!!% operators catch embed new error thrown cli::cli_abort(). message evaluates character vector, used message argument cli::cli_abort(). message evaluates function, function called one argument: caught error evaluating expr. current environment error_call object, used call argument cli::cli_abort().","code":""},{"path":"https://slap.tada.science/reference/slap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Slap Operator — slap","text":"","code":"# g() throws an error g <- function() { stop(\"ouch\") } # h() catches that error and embed it in a new error # with \"bam\" as its message, the g() error as the parent error, # and the caller environment as call= h <- function(error_call = rlang::caller_env()) { g() %!% \"bam\" } # f() will be used as the error call f <- function() { h() } # Error in `f()`: # ! bam # Caused by error in `g()`: # ! ouch tryCatch(f(), error = function(err) { print(err, backtrace = FALSE) }) #> <error/rlang_error> #> Error in `f()`: #> ! bam #> Caused by error in `g()`: #> ! ouch"},{"path":"https://slap.tada.science/news/index.html","id":"slap-202441","dir":"Changelog","previous_headings":"","what":"slap 2024.4.1","title":"slap 2024.4.1","text":"Initial CRAN submission.","code":""}] | ||
[{"path":"https://slap.tada.science/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 tada.science Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://slap.tada.science/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Romain François. Author, maintainer. tada.science. Copyright holder, funder.","code":""},{"path":"https://slap.tada.science/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"François R (2024). slap: Simplified Error Handling. R package version 2024.4.1, https://slap.tada.science, https://github.com/tadascience/slap.","code":"@Manual{, title = {slap: Simplified Error Handling}, author = {Romain François}, year = {2024}, note = {R package version 2024.4.1, https://slap.tada.science}, url = {https://github.com/tadascience/slap}, }"},{"path":"https://slap.tada.science/index.html","id":"slap-","dir":"","previous_headings":"","what":"Simplified Error Handling","title":"Simplified Error Handling","text":"goal slap simplify error handling.","code":""},{"path":"https://slap.tada.science/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Simplified Error Handling","text":"","code":"pak::pak(\"tadascience/slap\")"},{"path":"https://slap.tada.science/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"Simplified Error Handling","text":"","code":"library(dplyr) library(slap) # suppose you have a function that throws an error boom <- function() stop(\"An error occured in boom()\") # and you want to use it in e.g. dplyr::summarise() # summarise(mtcars, mpg = boom()) # if you want to catch it and rethrow an error that is more # meaningful to you, one way is to use withCallingHandlers() withCallingHandlers( summarise(mtcars, mpg = boom()), error = function(err) { cli::cli_abort(\"ouch\", parent = err) } ) # but that's kind of boring, so instead you can use the # slap operator %!% to slap away the eror summarise(mtcars, mpg = boom()) %!% \"ouch\" # or the double slap operator %!!% if you don't want to keep the parent error summarise(mtcars, mpg = boom()) %!!% \"ouch\""},{"path":"https://slap.tada.science/reference/slap.html","id":null,"dir":"Reference","previous_headings":"","what":"Slap Operator — slap","title":"Slap Operator — slap","text":"Slap Operator","code":""},{"path":"https://slap.tada.science/reference/slap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Slap Operator — slap","text":"","code":"expr %!% message expr %!!% message"},{"path":"https://slap.tada.science/reference/slap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Slap Operator — slap","text":"expr expression quosure evaluate carefully message message meant formatted cli::cli_bullets() function.","code":""},{"path":"https://slap.tada.science/reference/slap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Slap Operator — slap","text":"expr succeeds, result returned. expr generates error, %!% %!!% operators catch embed new error thrown cli::cli_abort(). message evaluates character vector, used message argument cli::cli_abort(). message evaluates function, function called one argument: caught error evaluating expr. current environment error_call object, used call argument cli::cli_abort().","code":""},{"path":"https://slap.tada.science/reference/slap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Slap Operator — slap","text":"","code":"# g() throws an error g <- function() { stop(\"ouch\") } # h() catches that error and embed it in a new error # with \"bam\" as its message, the g() error as the parent error, # and the caller environment as call= h <- function(error_call = rlang::caller_env()) { g() %!% \"bam\" } # f() will be used as the error call f <- function() { h() } # Error in `f()`: # ! bam # Caused by error in `g()`: # ! ouch tryCatch(f(), error = function(err) { print(err, backtrace = FALSE) }) #> <error/rlang_error> #> Error in `f()`: #> ! bam #> Caused by error in `g()`: #> ! ouch"},{"path":"https://slap.tada.science/news/index.html","id":"slap-202441","dir":"Changelog","previous_headings":"","what":"slap 2024.4.1","title":"slap 2024.4.1","text":"CRAN release: 2024-04-24 Initial CRAN submission.","code":""}] |