-
Notifications
You must be signed in to change notification settings - Fork 3
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
Log on failure #23
Conversation
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'] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
@jillh510, as per #3, this does not do any clever retry logic, but logs the failure and returns a 500.