Skip to content

Conversation

@pbrisbin
Copy link
Member

Before,

% AWS_PROFILE=x stack exec -- stackctl cat
CredentialChainExhausted

Now,

% AWS_PROFILE=x stack exec -- stackctl cat
2025-10-17 18:31:44 [error    ] No AWS credentials were found in your environment.
                                For details of where stackctl looks for credentials, see:
                                https://hackage.haskell.org/package/amazonka-2.0/docs/Amazonka-Auth.html#v:discover
                                exception=CredentialChainExhausted

Before,

```console
% AWS_PROFILE=x stack exec -- stackctl cat
CredentialChainExhausted
```

Now,

```console
% AWS_PROFILE=x stack exec -- stackctl cat
2025-10-17 18:31:44 [error    ] No AWS credentials were found in your environment.
                                For details of where stackctl looks for credentials, see:
                                https://hackage.haskell.org/package/amazonka-2.0/docs/Amazonka-Auth.html#v:discover
                                exception=CredentialChainExhausted
```
@pbrisbin pbrisbin requested a review from a team as a code owner October 17, 2025 18:32
@pbrisbin pbrisbin requested review from chris-martin and danroyo and removed request for a team and danroyo October 17, 2025 18:32
@pbrisbin pbrisbin enabled auto-merge (rebase) October 17, 2025 18:34
@pbrisbin pbrisbin linked an issue Oct 17, 2025 that may be closed by this pull request
Copy link
Contributor

@chris-martin chris-martin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful. I wonder if this should be upstreamed to be Amazonka's responsibility, because I want this behavior everywhere.

@pbrisbin pbrisbin merged commit 32b1386 into main Oct 17, 2025
5 checks passed
@pbrisbin pbrisbin deleted the pb/credential-chain-exhausted branch October 17, 2025 20:19
@pbrisbin
Copy link
Member Author

I wonder if this should be upstreamed

Depends on what you mean by "this". If you just mean improving displayException to include a little more details for this exception, that would make sense to me. We would still be doing things on our end to catch-log-exit, which I think should remain in the realm of library client.

@chris-martin
Copy link
Contributor

Yes, I mean rather than having to link to docs, that description should be embedded in the displayException output for any user of amazonka to be able to print it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Catch CredentialChangeExhausted and show more information

3 participants