Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(cli): handle nil unwrap errors when formatting (cherry-pick #18099)#18821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
matifali merged 1 commit intorelease/2.23fromcherry-pick-d0355e-release/2.23
Jul 10, 2025

Conversation

gcp-cherry-pick-bot[bot]
Copy link

Cherry-picked fix(cli): handle nil unwrap errors when formatting (#18099)

Discovered an unhelpful error when running a CLI command without internet (I didn't know I didn't have internet!):

$ coder lsEncountered an error running "coder list", see "coder list --help" for more informationerror: <nil>

The source of this was that callingUnwrap() onnet.DNSError can return nil, causing the whole error trace to get replaced by it. Instead, we'll just treat a nilUnwrap() return value as if there was nothing to unwrap.

The result is:

$ coder lsEncountered an error running "coder list", see "coder list --help" for more informationerror: query workspaces: Get "https://dev.coder.com/api/v2/workspaces?q=owner%3Ame": dial tcp: lookup dev.coder.com: no such host

Discovered an unhelpful error when running a CLI command without internet (I didn't know I didn't have internet!):```$ coder lsEncountered an error running "coder list", see "coder list --help" for more informationerror: <nil>```The source of this was that calling `Unwrap()` on `net.DNSError` can return nil, causing the whole error trace to get replaced by it. Instead, we'll just treat a nil `Unwrap()` return value as if there was nothing to unwrap.The result is:```$ coder lsEncountered an error running "coder list", see "coder list --help" for more informationerror: query workspaces: Get "https://dev.coder.com/api/v2/workspaces?q=owner%3Ame": dial tcp: lookup dev.coder.com: no such host```
@matifalimatifali merged commita7f0dba intorelease/2.23Jul 10, 2025
41 checks passed
@matifalimatifali deleted the cherry-pick-d0355e-release/2.23 branchJuly 10, 2025 05:43
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJul 10, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@matifalimatifalimatifali approved these changes

@ethanndicksonethanndicksonethanndickson approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@matifali@ethanndickson

[8]ページ先頭

©2009-2025 Movatter.jp