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

Add onError function to Query/Mutation Options #39

Merged
merged 1 commit into from
Jun 30, 2024

Conversation

ogaclejapan
Copy link
Contributor

The onError callback function is useful for error logging reporting and feedback you commonly want to handle on the client.

SwrCache(
    policy = SwrCachePolicy(
        ..
        queryOptions = QueryOptions(
            onError = { err, query, id -> 
                logger.error(err, "Query error: $query, id: $id")
            }
        ),
    )
)

The onError callback function is useful for error logging reporting and feedback you commonly want to handle on the client.
@ogaclejapan ogaclejapan merged commit f4e38a8 into main Jun 30, 2024
1 check passed
@ogaclejapan ogaclejapan deleted the error-callback-fn branch June 30, 2024 05:03
@github-actions github-actions bot mentioned this pull request Jun 30, 2024
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.

1 participant