Skip to content

Better handling of errors with rpc type google.rpc.LocalizedMessage #293

@jennybc

Description

@jennybc

gargle fell over when presenting a request failure for the user in tidyverse/googlesheets4#317

The error looked like:

# Error:
#   ! Failed to evaluate glue component {type}
# Caused by error:
#   ! object 'type' not found
# Run `rlang::last_trace()` to see where the error occurred.

I did correctly diagnose that the problem was the relevant API not being enabled for the service account in question, from the user's description of behaviour, which got them unstuck. But we really should have thrown a decent error message.

I got the user's raw response via email, which they'd captured for me using:

err <- gargle:::gargle_last_response()
saveRDS(err, "response.rds")

I now know what the problem is. Actually there's 1 problem and 1 opportunity to handle a new type of error message. I'll make changes for both.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions