Skip to content

Commit

Permalink
response['events_received'] doesn't exist if input invalid (#669)
Browse files Browse the repository at this point in the history
Summary:
Changed to process error

Pull Request resolved: #669

Reviewed By: liliarizona

Differential Revision: D61728915

Pulled By: stcheng

fbshipit-source-id: e91fd7de789a7f49ced987200e54e6533e1f8f0a
  • Loading branch information
cnukaus authored and facebook-github-bot committed Aug 24, 2024
1 parent f1810f9 commit 9a0e6fa
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,14 @@ async def create_event(self, session):
async def execute(self):
async with aiohttp.ClientSession() as session:
response = await self.create_event(session)
return EventResponse(events_received=response['events_received'],
if response.get('events_received'):
return EventResponse(events_received=response['events_received'],
fbtrace_id=response['fbtrace_id'],
messages=response['messages'])
else
return EventResponse(events_received=0,
fbtrace_id=response['fbtrace_id'],
messages=response['messages'])

def normalize(self):
normalized_events = []
Expand Down

2 comments on commit 9a0e6fa

@dominiczy
Copy link

Choose a reason for hiding this comment

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

@cnukaus there's a colon missing after else, which leads to SyntaxError on import

@cnukaus
Copy link
Contributor Author

@cnukaus cnukaus commented on 9a0e6fa Sep 6, 2024

Choose a reason for hiding this comment

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

okay, thanks for update. I have corrected this and tested locally. Now adding another PR with 1 additional file corrected #682

Please sign in to comment.