How to implement error handling

27 views
Skip to first unread message

Anand Kane

unread,
Jan 18, 2021, 12:23:29 AM1/18/21
to Syndesis
Hi Folks

Can someone please help me with how to implement error handling and reporting in Syndesis? For now, I have the following two cases to implement error handling, but it would be great to learn how it is achieved in general in Syndesis.

Case 1: I have a step extension and there can be an exception raised in it. How do I report this to the end user in the integration output using a sensible message?

Case 2:  I have a simple pipeline like below.
Webhook (receive Salesforce Lead id) -> Salesforce (fetch Lead) -> Data mapper (modify last_name) -> Salesforce (create new Lead)

In step two, when a Lead is not found for a given id, the pipeline execution is halted but nothing is reported in the integration output in the web UI. In the logs of the integration container, I see a message about NOT_FOUND Lead, but that is logged from WebhookErrorHandler. 

Another related question is, how to achieve internationalization?

Thanks
Anand

Zoran Regvart

unread,
Jan 18, 2021, 3:37:19 AM1/18/21
to Anand Kane, Syndesis
Hi Anand,

On Mon, Jan 18, 2021 at 6:23 AM 'Anand Kane' via Syndesis
<synd...@googlegroups.com> wrote:
> Case 1: I have a step extension and there can be an exception raised in it. How do I report this to the end user in the integration output using a sensible message?

Have a look at the error handling design documentation[1], for
extensions you have the ability do lower level Camel routes[2], so you
might be able to do use try-catch[3] idiom from Camel (I haven't tried
this).

> Case 2: I have a simple pipeline like below.
> Webhook (receive Salesforce Lead id) -> Salesforce (fetch Lead) -> Data mapper (modify last_name) -> Salesforce (create new Lead)
>
> In step two, when a Lead is not found for a given id, the pipeline execution is halted but nothing is reported in the integration output in the web UI. In the logs of the integration container, I see a message about NOT_FOUND Lead, but that is logged from WebhookErrorHandler.

Have you tried to configure error handling on the WebHook[4]?

> Another related question is, how to achieve internationalization?

UI has support for this have a look at the readme[5]

zoran

[1] https://github.com/syndesisio/syndesis/blob/master/project/designs/error-handling.md
[2] https://syndesis.io/manual/developing_extensions/#example-route-builder_step-alternatives
[3] https://camel.apache.org/manual/latest/try-catch-finally.html
[4] https://syndesis.io/manual/integrating-applications/#start-with-webhook-connection_webhook
[5] https://github.com/syndesisio/syndesis/tree/master/app/ui-react#internationalization
--
Zoran Regvart

Anand Kane

unread,
Jan 21, 2021, 8:13:03 AM1/21/21
to Syndesis
Hi Zoran

Thanks for the response. 

Yes, I tried configuring error handling in Webhook. And accordingly, I also get HTTP 404 response from the Webhook request. However, The error message is not seen in the activity log (I remember documentation mentions this fact somewhere). I thought with some changes in WebhookOnExceptionHandler, I will be able to show errors in activity logs. However, changes to this class are not picked up in the integration because the 'integration build' pod does not use the locally built syndesis-s2i image. It pulls an image with a different 'digest' although a locally built image is present. Contrary to this, syndesis-meta and syndesis-server pods are created using the locally built respective images.

Could you please comment on how can I instruct the integration creation process to use the locally built syndesis-s2i image?

Regards
Anand

Kurt Stam

unread,
Jan 21, 2021, 9:08:55 AM1/21/21
to Anand Kane, Syndesis
I Anand,

Since the error is “handled” and communicated back to the client this counts as a successful transaction and therefore there are no errors in the logs.

As far as the other issue I think the ImageStream for the i2s image needs to be updated to point to your latest docker image. Try

oc edit is <name>

Hope this helps!
—Kurt

--
You received this message because you are subscribed to the Google Groups "Syndesis" group.
To unsubscribe from this group and stop receiving emails from it, send an email to syndesis+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/syndesis/2d72291f-cd5f-499a-a555-c270d26f7a4dn%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages