Improve error message on failure to launch
Closed this issue · 0 comments
gadenbuie commented
dir(tempdir(), pattern = "chrome-", full.names = TRUE)
can be used to find the logs from the chromote process when it fails to launch.
[The]
chromote
package should either (1) automatically include those logs as part of the error output, or (2) inform the user that they can read those log files to get more error details. Right now the error is unfortunately rather opaque.
Originally posted by @kevinushey in rstudio/rstudio#12960 (comment)
Example error message from #150
library(chromote)
packageVersion('chromote')
#> [1] ‘0.2.0’
chromote::find_chrome()
#> [1] "/usr/lib64/chromium-browser/chromium-browser"
b <- ChromoteSession$new()
#> Error in `with_random_port()`:
#> ! Cannot find an available port. Please try again.
#> Caused by error in `startup()`:
#> ! Failed to start chrome. Error:
#> Run `rlang::last_trace()` to see where the error occurred.
rlang::last_trace()
#> <error/error_no_available_port>
#> Error in `with_random_port()`:
#> ! Cannot find an available port. Please try again.
#> Caused by error in `startup()`:
#> ! Failed to start chrome. Error:
#> ---
#> Backtrace:
#> ▆
#> 1. └─ChromoteSession$new()
#> 2. └─chromote (local) initialize(...)
#> 3. └─chromote::default_chromote_object()
#> 4. ├─chromote::set_default_chromote_object(Chromote$new())
#> 5. └─Chromote$new()
#> 6. └─chromote (local) initialize(...)
#> 7. └─Chrome$new()
#> 8. └─chromote (local) initialize(...)
#> 9. └─chromote:::launch_chrome(path, args)
#> 10. └─chromote:::with_random_port(launch_chrome_impl, path = path, args = args)
#> Run rlang::last_trace(drop = FALSE) to see 1 hidden frame.