Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing exception cause in AmplifyExceptions #2827

Open
1 task done
vunguyen112 opened this issue May 22, 2024 · 1 comment
Open
1 task done

Missing exception cause in AmplifyExceptions #2827

vunguyen112 opened this issue May 22, 2024 · 1 comment
Assignees
Labels
api bug Something isn't working

Comments

@vunguyen112
Copy link

vunguyen112 commented May 22, 2024

Before opening, please confirm:

Language and Async Model

Kotlin, Kotlin - Coroutines

Amplify Categories

GraphQL API

Gradle script dependencies

// Put output below this line
implementation 'com.amplifyframework:core-kotlin:2.14.0'
implementation 'com.amplifyframework:aws-api:2.14.0'

Environment information

# Put output below this line


Please include any relevant guides or documentation you're referencing

No response

Describe the feature request

When the token is expired the Amplify.API.query/Amplify.API.subscribe returns the general exception without the underlying cause of the exception.

  • Query: AmplifyException{message=OkHttp client request failed., cause=null, recoverySuggestion=Irrecoverable error

  • Subscribe: AmplifyException{message=Connection failed., cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet. (The same with no internet connection exception).

The lib should add the cause of this exception something like ApiAuthException instead of returning null, so the app can detect what is wrong.

Initialization steps (if applicable)

No response

Code Snippet

val authProviders = ApiAuthProviders.builder()
    .oidcAuthProvider { "[OPEN-ID-CONNECT-TOKEN]" }
    .build()
val plugin = AWSApiPlugin.builder()
    .apiAuthProviders(authProviders)
    .build()
Amplify.addPlugin(plugin)

amplifyconfiguration.json

No response

GraphQL Schema

// Put your schema below this line

Additional information and screenshots

No response

@github-actions github-actions bot added the pending-triage Issue is pending triage label May 22, 2024
@vunguyen112 vunguyen112 changed the title Unclear exception cause in AmplifyExceptions Missing exception cause in AmplifyExceptions May 22, 2024
@mattcreaser mattcreaser added bug Something isn't working api labels May 22, 2024
@github-actions github-actions bot removed the pending-triage Issue is pending triage label May 22, 2024
@mattcreaser
Copy link
Member

Thanks for the report @vunguyen112. We'll look into this issue.

@edisooon edisooon self-assigned this Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants