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

[PW-6453] - Ensure all exceptions thrown by resolvers are GraphQl exceptions #1413

Merged
merged 30 commits into from Mar 28, 2022

Conversation

Morerice
Copy link
Contributor

Description
Currently in some cases, (if there is an error with the payload in the details call in graphql) a normal exception is thrown. Ultimately this is caught and 'changed' to a graphQl exception, but the message sent back will be Internal Server Error, which is not informative.

A new Exception should be created, specific to graphQl. Ideally we would also check, based on the exception code if the message can be displayed to the user. The latter functionality would also be usable in non-graphql requests in the future.

Tested scenarios

  • GetAdyenPaymentStatus:

    • Invalid orderNumber, cartId combination - GraphQlNoSuchEntityException
  • GetAdyenPaymentDetails:

    • Invalid orderId - GraphQlNoSuchEntityException
    • Invalid json - GraphQlInputException
    • Invalid payload - GraphQlAdyenException
  • GetAdyenPaymentMethods:

    • Invalid cartId - GraphQlNoSuchEntityException
    • Invalid user - GraphQlAuthorizationException
    • Exception thrown during Adyen client initialization - GraphQlAdyenException

…if the cart is related to the customer AFTER the cart becomes inactive
…cart_id, which is then picked up by the adyenPaymentStatus
…. Use them in the graphQl payment details resolver
@sonarcloud
Copy link

sonarcloud bot commented Mar 28, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@Morerice Morerice merged commit 896583f into develop Mar 28, 2022
@Morerice Morerice deleted the PW-6453 branch March 28, 2022 13:00
@Morerice Morerice mentioned this pull request Mar 28, 2022
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.

None yet

4 participants