Skip to content

Nicer error message when ATTUNE_API_ENDPOINT is invalid #157

Description

@jssblck

Today, if you run attune with a ATTUNE_API_ENDPOINT value that specifies a server that doesn't exist, it results in a very unhelpful error:

ATTUNE_API_ENDPOINT=https://somehost.doesnotexist attune apt repo list 

thread 'main' panicked at packages/attune/src/bin/attune/main.rs:78:10:
Could not reach API server: reqwest::Error { kind: Request, url: "https://somehost.doesnotexist/api/v0/compatibility", source: hyper_util::client::legacy::Error(Connect, ConnectError("dns error", Custom { kind: Uncategorized, error: "failed to lookup address information: nodename nor servname provided, or not known" })) }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

We should capture errors like this and surface a nicer message for users.

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