Skip to content

fix: Cleaner error when not authenticated and token file is missing#366

Merged
kodiakhq[bot] merged 2 commits into
mainfrom
fix/clean-not-authenticated-error
Jun 19, 2026
Merged

fix: Cleaner error when not authenticated and token file is missing#366
kodiakhq[bot] merged 2 commits into
mainfrom
fix/clean-not-authenticated-error

Conversation

@disq

@disq disq commented Jun 19, 2026

Copy link
Copy Markdown
Member

When no token file exists (user never ran cloudquery login), GetToken now returns a concise "not authenticated" message instead of leaking the wrapped os.ReadFile error (failed to read refresh token: failed to read file: open …/cloudquery/token: no such file or directory); genuine read errors still surface verbosely.

Currently, the error message from cloudquery switch right after cloudquery logout:

Error: failed to get auth token: failed to read refresh token: failed to read file: open /Users//Library/Application Support/cloudquery/token: no such file or directory. Hint: You may need to run cloudquery login or set CLOUDQUERY_API_KEY

@disq
disq requested a review from a team as a code owner June 19, 2026 10:18
@disq
disq requested review from erezrokah and murarustefaan and removed request for a team June 19, 2026 10:18
@disq disq added the automerge Add to automerge PRs once requirements are met label Jun 19, 2026
@kodiakhq
kodiakhq Bot merged commit e559cba into main Jun 19, 2026
8 checks passed
@kodiakhq
kodiakhq Bot deleted the fix/clean-not-authenticated-error branch June 19, 2026 10:39
kodiakhq Bot pushed a commit that referenced this pull request Jun 24, 2026
🤖 I have created a release *beep* *boop*
---


## [1.14.11](v1.14.10...v1.14.11) (2026-06-19)


### Bug Fixes

* Cleaner error when not authenticated and token file is missing ([#366](#366)) ([e559cba](e559cba))
* Generate CloudQuery Go API Client from `spec.json` ([#364](#364)) ([c9fbe79](c9fbe79))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Add to automerge PRs once requirements are met

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants