OpenFn / primero-progres

Interoperability solution for UNICEF <> UNHCR interagency referrals between Primero and Progres v4 systems.
https://openfn.github.io/primero-progres/
0 stars 2 forks source link

Need improved error handling when custom error thrown #65

Closed aleksa-krolls closed 1 year ago

aleksa-krolls commented 1 year ago

Describe the bug

This run doesn't show me the case progres_interventionnumber so I have no idea which record this error is related to. This error message needs to be updated to include system identifiers (progres_interventionnumber).

Error: Service value shared is not an accepted UNICEF service type. Please see the mapping specifications.

To Reproduce

Run the job against this message: https://www.openfn.org/projects/primero-progres-v4-staging/messages/064f850c-6b81-7b25-8229-a7437cf3def2

expression.js

Please make changes on a branch off of main, and submit PR to staging when ready to test.

Link to the job itself in Github: https://github.com/OpenFn/primero-progres/blob/master/jobs/PROD/f1-1.sendReferralsToPrimero.js

state.json

{
  "configuration": ["SEE LAST PASS: 'Primero Gambella Demo [openfn testing]'"],
  "data": { https://www.openfn.org/projects/primero-progres-v4-staging/messages/064f850c-6b81-7b25-8229-a7437cf3def2 },
}

Expected behavior

The run should fail against the message above but the log should include the progres_interventionnumber.

To test/resolve

  1. After the desired output is working locally (from the CLI), please [push commits to master || open a pull request].
aleksa-krolls commented 1 year ago

@daissatou2 see the email exchange with Jan. Can you pls finish this issue and find some sample data Mtuchi can work with to address this?

mtuchi commented 1 year ago

@daissatou2 i have added the service and progres_interventionnumber on custom error message