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

Exceptions in subscriptions is not logging #280

Open
GinTR1k opened this issue Jul 8, 2020 · 2 comments
Open

Exceptions in subscriptions is not logging #280

GinTR1k opened this issue Jul 8, 2020 · 2 comments

Comments

@GinTR1k
Copy link

GinTR1k commented Jul 8, 2020

Hello!

I've just found that exceptions in subscriptions are not logging, but the message of an exceptions returns to client.

class OrderBookSubscription(graphene.ObjectType):
    order_book = graphene.Field(
        OrderBook,
        pair_id=graphene.Int(required=True)
    )

    @classmethod
    async def resolve_order_book(cls, root, info, pair_id):
        listener = info.context['not exists key']

Request:

{"id":"3","type":"start","payload":{"variables":{"pairId":11},"extensions":{},"operationName":"OrderBookWS","query":"subscription OrderBookWS($pairId: Int!) {\n  orderBook(pairId: $pairId) {\n    buy {\n      price\n      volume\n      share\n      __typename\n    }\n    sell {\n      price\n      volume\n      share\n      __typename\n    }\n    spread\n    __typename\n  }\n}\n"}}

Response:

{"id": "3", "type": "data", "payload": {"data": {"orderBook": null}, "errors": [{"message": "'not exists key'"}]}}
{"id": "3", "type": "complete"}

Logs:

======== Running on http://0.0.0.0:8080 ========
(Press CTRL+C to quit)
2020-07-08 12:06:15,070 - Rx - DEBUG - CurrentThreadScheduler.schedule(state=None)
2020-07-08 12:06:15,072 - Rx - DEBUG - CurrentThreadScheduler.schedule(state=None)
2020-07-08 12:06:15,072 - Rx - DEBUG - CurrentThreadScheduler.schedule(state=None)

Also i've found exception handler, in which need to log the exception.
https://github.com/graphql-python/graphql-core-legacy/blob/master/graphql/execution/executors/asyncio_utils.py#L28

@shalakhin
Copy link

shalakhin commented Jul 8, 2020

@Cito could you add this as we also need that thing to be fixed?

@GinTR1k
Copy link
Author

GinTR1k commented Jul 10, 2020

@syrusakbary
@jhgg
@dittos

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

No branches or pull requests

2 participants