-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Switch from `stop()` to `abort()` and pass along `error_call` to ensure errors point to user facing functions. * Switch from `warning()` to `pool_warn()`, which users `file(cat = stderr)` because condition handling isn't avaiable in `reg.finalizer()` or `later::later()`. * Where appropriate, replace `tryCatch()` with `withCallingHandlers()` to get better tracebacks.
- Loading branch information
Showing
14 changed files
with
311 additions
and
182 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -21,7 +21,7 @@ Imports: | |
DBI, | ||
later (>= 1.0.0), | ||
R6, | ||
rlang | ||
rlang (>= 1.0.0) | ||
Suggests: | ||
covr, | ||
dbplyr, | ||
|
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
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
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# createObject throws if `factory` throws or returns NULL | ||
|
||
Code | ||
poolCreate(MockPooledObj) | ||
Condition | ||
Error in `poolCreate()`: | ||
! `factory` must be a function. | ||
Code | ||
poolCreate(function(x) NULL) | ||
Condition | ||
Error in `poolCreate()`: | ||
! Object creation failed. | ||
* The `factory` must not return `NULL` | ||
|
||
# useful warning if onDestroy fails | ||
|
||
Code | ||
poolReturn(b) | ||
later::run_now() | ||
Output | ||
<pool> Object could not be destroyed, but was removed from the pool. | ||
<pool> Error message: | ||
<pool> Destruction failed... | ||
|
Oops, something went wrong.