Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Trigger Error mediator #2266

Merged
merged 2 commits into from
Dec 18, 2024
Merged

Conversation

GDLMadushanka
Copy link
Contributor

Purpose

Add Trigger Error mediator

Add Trigger Error mediator
<triggererror type="string" (errorMessage="string" | expression="expression")/>
* Creates a trigger error mediator through the supplied XML configuration
* <p/>
* <pre>
* &lt;triggererror type="string" (errorMessage="string" | expression="expression")/&gt;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of having two attributes for literal and expression, is it possible to have a Value ?

Copy link
Contributor Author

@GDLMadushanka GDLMadushanka Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean the following syntax
<throwError type="string">(value | expression)</ throwError>
or
<throwError type="string" errorMessage="value" />

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<throwError type="string" errorMessage="value" /> looks better

private static final QName ATT_ERROR_MSG = new QName("errorMessage");
private static final QName ATT_TYPE = new QName("type");
private static final QName TRIGGER_ERROR_Q
= new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "triggererror");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trigger-error is more readable. WDYT?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

throw-error is much better IMO

Copy link
Contributor Author

@GDLMadushanka GDLMadushanka Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have the following naming convention in mediators

<datamapper config="name" inputSchema="string" inputType="string" outputSchema="string" outputType="string"/> 
<jsontransform [schema="string"]> 
<dataServiceCall serviceName="data-service-name">

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then throwError?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Address review comments
@GDLMadushanka GDLMadushanka merged commit 3eebed4 into wso2:master Dec 18, 2024
1 check failed
@GDLMadushanka
Copy link
Contributor Author

related to wso2/product-micro-integrator#3843

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants