Error Information for evaluation

I am attempting to do the following:

1. Evaluate if there was an error during the import

2. Create a hook that will set a flag as an error or a success based on the status code.

3. If there is an error then take the system error message and change it to a user friendly error message.

4. If there isn't then send to the mapping a success message.

The biggest struggle I'm facing at this point is pulling in any and all error information and evaluating it. I have tried a PostSubmit hook after the import and I've done a premap hook prior to the next step. and the JS to pull in the error source, message, and code is eluding me.

Does anyone know the quickest way to get the error information into a hook that can be evaluated with some JS and produce a field that can be evaluated by a future hook or during the handlebar mapping?

Hi, @davidromstad. I'll have to leave it other Community members who've gone down this road before to offer tips on error visibility and – if we're lucky – code snippets.

I did want to reply with a couple alternatives that might get you closer to your goal in the meantime:

  1. If your account has API management and you'd upgraded to Error Management 2.0, then you can access errors programmatically through the integrator.io errors API. (There's also a template in the Marketplace with sample code.)
  2. Some third-party APIs have a validation, or /errors, endpoint. If so, you could do a lookup via that URI after your import step and handle the records returned accordingly, returning them to the flow's errors. (The Orderful – NetSuite template contains examples of this method of error-handling in the NetSuite to Orderful flows, assuming you have accounts to those apps to be able to install the template.)

Hey David,

I think this article should show you how to do exactly what you're asking about. You're correct that you should use a postSubmit hook.

Thanks,
-Lucian

Thank you both for your responses. This had pointed me in the right direction.