Skip to content

Conversation

@BewareMyPower
Copy link
Contributor

Motivation

When a token supplier is passed to the AuthToken, if exceptions are thrown from it, the application will crash immediately. A typical case is the Python wrapper might raise an exception when trying to get token.

Modifications

Catch the exception in Commands::newConnect because the token supplier is called in it. Then convert it to ResultAuthenticationError. Add testTokenSupplierException to verify it.

### Motivation

When a token supplier is passed to the `AuthToken`, if exceptions are
thrown from it, the application will crash immediately. A typical case
is the Python wrapper might raise an exception when trying to get token.

### Modifications

Catch the exception in `Commands::newConnect` because the token supplier
is called in it. Then convert it to `ResultAuthenticationError`. Add
`testTokenSupplierException` to verify it.
@BewareMyPower BewareMyPower added the enhancement New feature or request label Nov 27, 2024
@BewareMyPower BewareMyPower added this to the 3.7.0 milestone Nov 27, 2024
@BewareMyPower BewareMyPower self-assigned this Nov 27, 2024
@BewareMyPower BewareMyPower merged commit e264cf7 into apache:main Nov 27, 2024
14 checks passed
@BewareMyPower BewareMyPower deleted the bewaremypower/fix-token-auth-supplier branch November 27, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants