Closed daissatou2 closed 2 years ago
@daissatou2 unfortunately there is no other way and the logs are auto-generated so we got no hands in it.
One typical way is to defined our own split method somewhere and use it instead of the built-in string split method
@lakhassane @daissatou2 I recommend you two get on a call to (1) determine the exact cause of the error here, (2) consider where in the job we need to handle for undefined values, and (3) discuss general troubleshooting UX/ if there's anything we can do in logging to help.
With a quick check I can see there is not a risk_assessment
object in the message. So it's likely that L227
can potentially trigger this error.
@daissatou2 I find out the reason. It was still risk_assessment
being undefined. However this issue is also related to upsertIf
that evaluates the mapping before even checking if it should upsert or not (with the if
).
I made a correction with the custom split
we discuss so the job does not fail but I will also update salesforce
to prevent this for next time.
Find the run here: https://www.openfn.org/projects/pd3yk4/runs/06178336-9acf-7d3e-8792-3ff4551d586c
Describe the bug
I am seeing the error "TypeError [Error]: Cannot read property 'split' of undefined" for
Upsert Risk & Vulnerability Assessment | Service Referral
. We are calling the split function on several fields. Is there an easy way to determine which field(s) is causing this error without having to check each field? Maybe an update to the logs?To Reproduce
expression.js
Link to the job itself in Github: https://github.com/OpenFn/grassroot-soccer/blob/master/jobs/upsertRiskVulnerabilityNewReferrals.js
state.json
Salesforce: GRS Salesforce Production https://www.openfn.org/projects/pd3yk4/messages/06177051-a47e-731c-82de-e882d34bacd5
To test/resolve