You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm using a slightly modified version of a snippet of code from the README.
I have altered: @client.trigger(event.BattleRankUp) to @client.trigger(event.MetagameEvent).
Here is my code:
importasynciofromauraxiumimportevent, ps2asyncdefmain():
# Initialise event streaming client to the Planetside 2 Census APIclient=event.EventClient(service_id="s:example")
# Register client trigger@client.trigger(event.MetagameEvent)asyncdefshow_event(evt):
print(repr(evt))
print(evt)
if__name__=="__main__":
loop=asyncio.get_event_loop()
loop.create_task(main())
loop.run_forever()
However, the following error occurs on when an event is received:
auraxium\event\_client.py:167> exception=ValidationError(model='MetagameEvent', errors=[{'loc': ('experience_bonus',), 'msg': 'value is not a valid integer', 'type': 'type_error.integer'}])>
Is my usage incorrect?
The text was updated successfully, but these errors were encountered:
dbrennand
changed the title
BUG:
BUG: ('experience_bonus',), 'msg': 'value is not a valid integer', 'type': 'type_error.integer'}])>
May 14, 2021
dbrennand
changed the title
BUG: ('experience_bonus',), 'msg': 'value is not a valid integer', 'type': 'type_error.integer'}])>
('experience_bonus',), 'msg': 'value is not a valid integer', 'type': 'type_error.integer'}])>
May 14, 2021
Hi, this looks like a problem with pydantic, not your code.
Auraxium uses a pydantic model for all messages it receives to validate and parse them into the object model representation. This gem of a message is its way of complaining about bad types. I have created an issue for this lack of information; this really should not result in a user-facing error message as this is not provoked by your code (#51).
It looks like there are alerts whose experience type is a float or other non-integer type. I started logging a session, but it might take a while before we get an alert violating the constraint. I confirmed that this was the issue, a fix is underway.
The issue with your snippet has been resolved. Similar data model incompatibilities should now also result in a more helpful error message that also includes the offending payload to make correcting the model faster.
Thank you for the report!
Hi, I'm using a slightly modified version of a snippet of code from the README.
I have altered:
@client.trigger(event.BattleRankUp)
to@client.trigger(event.MetagameEvent)
.Here is my code:
However, the following error occurs on when an event is received:
Is my usage incorrect?
The text was updated successfully, but these errors were encountered: