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

Log on failure #23

Merged
merged 5 commits into from
Apr 24, 2018
Merged

Log on failure #23

merged 5 commits into from
Apr 24, 2018

Conversation

tkell
Copy link
Contributor

@tkell tkell commented Apr 20, 2018

@jillh510, as per #3, this does not do any clever retry logic, but logs the failure and returns a 500.

sync/views.py Outdated

return_status, result_string = knackload.load(json.dumps(knack_value))

if return_status != 200:
print('Error: We failed to send {} to knack'.format(knack_value))
contribution_refcode = knack_value['field_638']
Copy link
Contributor

Choose a reason for hiding this comment

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

'field_638' is the date. Please log the order_id from ActBlue instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, this code will crash in debug mode because those fields won't exist in knack_value.

sync/views.py Outdated

error_msg = 'Error: We failed to send order {}, lineitem {} to knack'
print(error_msg.format(order_id, lineitem_entity_id))
log_debug('Error: We failed to send ' + knack_value)
Copy link
Contributor

Choose a reason for hiding this comment

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

need to json.dumps here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@jillh510 jillh510 merged commit 9a013c7 into RagtagOpen:master Apr 24, 2018
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.

3 participants