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

1660: Handle apollo errors #1878

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

f1sh1918
Copy link
Contributor

@f1sh1918 f1sh1918 commented Jan 21, 2025

Short description

We have the issue that all non GraphlBaseExceptions will result in the same message to the user and 403 exceptions will be handled as a network error and just result in Server nicht erreichbar

Proposed changes

  • remove the check for networkError but handle all errors which are not graphql errors in a defaultErrorMap and check for the particular error code and send the matching error message
  • if non of these error codes were found just then return 'Server nicht erreichbar', because we didn't get any response from the backend (the most probably reason i guess)

Side effects

  • some error messages may change or not be displayed

Testing

I'm not pretty sure how to test this on staging because, most of the errors were handled before by not showing the function like PepperSettings or `ApiTokenSettings``
As a dev you can follow the instructions in the related issue to test the error messages

Resolved issues

Fixes: #1660

title: string
description?: string | ReactElement
}

const getMessageFromApolloError = (error: ApolloError): GraphQLErrorMessage => {
const defaultMessage = 'Etwas ist schief gelaufen.'

if (error.networkError) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure if everything is still catched. All i tested was catched by DefaultErrorMap
Maybe there is also sth misconfigured so that 403 were classified as NetworkErrors accidently?

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.

Handle apollo errors correctly
1 participant