Add functionality so that if one entry breaks during a batch, it will…#9
Add functionality so that if one entry breaks during a batch, it will…#9jamesuejio merged 1 commit intomasterfrom
Conversation
ach/builder.py
Outdated
| entry_counter += 1 | ||
| entries.append((entry, record.get('addenda', []))) | ||
| entry_counter += 1 | ||
| except: |
There was a problem hiding this comment.
Can we return what type of failure it was?
Swallowing the error on a bunch of lines will help but, I believe we can do a better job by informing the user what the errors are or where they happened.
There was a problem hiding this comment.
Sure how do you think we should return the error? Should I add the error message in the entry? Or have failed_entries a tuple of entry dict and error message?
There was a problem hiding this comment.
Tuple is ok for now but we could return an either type in the future.
There was a problem hiding this comment.
Hmm, Felippe, looking closer at your comment you're totally right. Can we log it with some kind of unique identifier to find that detail if not obvious from the data itself returned to the caller? This is a library so not sure what the convention is in python for logging in libraries, thoughts?
13ff82d to
8b240c9
Compare
… not crash the entire batch
8b240c9 to
c116468
Compare
|
Changes look awesome, I feel like there should be an obvious test we can add? |
|
Oh there are tests in this repo! Let me add a quick one |
|
Actually can't figure out how to run them and the last commits to tests were 6 years so not sure it's worth trying to figure it out. |
… not crash the entire batch