Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Could not parse cli {} expression #254

@aculham

Description

@aculham

In the last couple of days I have started to see some transient errors upon uploading a file to Google Drive via the googledrive package. The errors seem to be originating in the gargle package, which is why I am posting this here. Unfortunately, I cannot provide a reproducible example since the error doesn't happen every time. I am unable to identify any pattern in when it fails or doesn't. Below is the error and traceback. Any advice would be appreciated.

Error in `fun(..., .envir = .envir)`:
! Could not parse cli `{}` expression: ` font-family: ver...`.
Caused by error in `parse(text = code, keep.source = FALSE)`:
! <text>:1:22: unexpected ','
1:  font-family: verdana,
                         ^
Type .Last.error to see the more details.
Backtrace:
 1. global upload_drive_file("C:\\temp.7z", "Data")
 2. googledrive::drive_upload(file_path, path = id, overwrite = overwrite) at google_drive.R:89:5
 3. googledrive::as_dribble(list(gargle::response_process(response)))
 4. gargle::response_process(response)
 5. gargle:::gargle_abort_request_failed(error_message(resp), resp)
 6. gargle:::gargle_abort(message, class = c("gargle_error_request_failed", ...
 7. cli::cli_abort(message, class = c(class, "gargle_error"), .envir = .envir, ...
 8. cli:::vcapply(message, format_inline, .envir = .envir)
 9. base::vapply(X, FUN, FUN.VALUE = character(1), ..., USE.NAMES = USE.NAMES)
10. local error_message(resp)
11. gargle::response_as_json(resp)
12. gargle:::check_for_json(resp)
13. gargle:::gargle_abort_request_failed(c(gargle_map_cli(type, template = "Expected content type {.field application/json}, not \\\n                    {.field <<x>>}."), ...
14. gargle:::gargle_abort(message, class = c("gargle_error_request_failed", ...
15. cli::cli_abort(message, class = c(class, "gargle_error"), .envir = .envir, ...
16. cli:::vcapply(message, format_inline, .envir = .envir)
17. base::vapply(X, FUN, FUN.VALUE = character(1), ..., USE.NAMES = USE.NAMES)
18. local FUN(X[[i]], ...)
19. cli::cli_fmt(fun(..., .envir = .envir), collapse = collapse, strip_newline = TRUE)
20. cli:::cli__rec(expr)
21. local fun(..., .envir = .envir)
22. cli:::cli__message("inline_text", list(text = glue_cmd(..., .envir = .envir, ...
23. "id" %in% names(args)
24. cli:::glue_cmd(..., .envir = .envir, .call = sys.call(), .trim = FALSE)
25. cli:::glue(str, .envir = .envir, .transformer = transformer, .cli = TRUE, ...
26. (function (expr) ...
27. .transformer(expr, .envir) %||% character()
28. local .transformer(expr, .envir)
29. parse(text = code, keep.source = FALSE) %??% cli_error(call. = caller, ...
30. cli:::chain_error(expr, err, srcref = utils::getSrcref(sys.call()))
31. | base::withCallingHandlers({ ...
32. base::parse(text = code, keep.source = FALSE)
33. base::.handleSimpleError(function (e) ...
34. | local h(simpleError(msg, call))
35. | cli:::throw_error(err, parent = e)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions