google/googleapis.dart

The error message when `clientViaApplicationDefaultCredentials` fallbacks to reading `metadata` servers (and failing) is cryptic

Open

#572 创建于 2023年10月11日

在 GitHub 查看
 (3 评论) (0 反应) (0 负责人)Dart (133 fork)github user discovery
enhancementhelp wanted

仓库指标

Star
 (419 star)
PR 合并指标
 (PR 指标待抓取)

描述

Context for this issue: https://github.com/invertase/dart_firebase_admin/issues/6

It appears that if a user tries to create a client with clientViaApplicationDefaultCredentials, yet have neither the environment nor gcloud/application_default_credentials.json setup, then google_apis_auth fallbacks to reaching out to metadata.google.internal.

The problem is that if that endpoint is unavailable (which is likely the case if the user made a mistake and did want to login using the other options), then we end-up with a "Failed host lookup: 'metadata.google.internal'" error.

This is likely confusing, and a better error message could make it more intuitive to understand what the issue is.

贡献者指南