File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 1
1
# webshot2 (development version)
2
2
3
+ * ` webshot() ` now surfaces errors that occur when working with the lower-level screenshot API provided by Chrome via ` {chromote} ` . (#69 )
4
+
3
5
# webshot2 0.1.1
4
6
5
7
* ` webshot() ` now supports JPEG (` .jpg ` or ` .jpeg ` ) and WEBP (` .webp ` ) image formats. (@trafficonese #45 )
Original file line number Diff line number Diff line change @@ -251,6 +251,7 @@ new_session_screenshot <- function(
251
251
252
252
253
253
s <- NULL
254
+ err <- NULL
254
255
255
256
p <- chromote $ new_session(wait_ = FALSE ,
256
257
width = vwidth ,
@@ -296,8 +297,14 @@ new_session_screenshot <- function(
296
297
if (! isTRUE(quiet )) message(url , " screenshot completed" )
297
298
normalizePath(value )
298
299
})$
300
+ catch(function (err ) {
301
+ err <<- err
302
+ })$
299
303
finally(function () {
300
- s $ close()
304
+ # Close down the session if we successfully started one
305
+ if (! is.null(s )) s $ close()
306
+ # Or rethrow the error if we caught one
307
+ if (! is.null(err )) signalCondition(err )
301
308
})
302
309
303
310
p
You can’t perform that action at this time.
0 commit comments