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

MaskErrors does not work since version 0.240.0 #3625

Closed
ericdevries opened this issue Sep 12, 2024 · 2 comments · Fixed by #3629
Closed

MaskErrors does not work since version 0.240.0 #3625

ericdevries opened this issue Sep 12, 2024 · 2 comments · Fixed by #3629
Labels
bug Something isn't working

Comments

@ericdevries
Copy link

ericdevries commented Sep 12, 2024

Since version 0.240.0, the MaskErrors extension fails to mask errors.

Describe the Bug

See example script here:

import typing
import strawberry

from strawberry.extensions import MaskErrors


@strawberry.type
class Book:
    title: str
    author: str


def get_books():
    raise Exception("Something went wrong")


@strawberry.type
class Query:
    books: typing.List[Book] = strawberry.field(resolver=get_books)


schema = strawberry.Schema(query=Query, extensions=[MaskErrors(error_message="Internal server error")])

In the previous version it would show Internal server error as the message. Since 0.240.0 it shows this:

{
  "data": null,
  "errors": [
    {
      "message": "Something went wrong",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "books"
      ]
    }
  ]
}

System Information

  • Operating system: macos
  • Strawberry version (if applicable): 0.240.0 and up

Additional Context

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@ericdevries ericdevries added the bug Something isn't working label Sep 12, 2024
@patrick91
Copy link
Member

I'll check this today! thanks for the report 😊

@ericdevries
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants