Skip to content

Commit

Permalink
fix: return error closest to the source and return all nested errors (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
MLenterman authored Jul 10, 2024
1 parent 74652fa commit c8c35a8
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
<xsl:output method="text" version="1.0" encoding="UTF-8" omit-xml-declaration="yes"/>

<xsl:template match="/">
<xsl:apply-templates select="error" />
<xsl:apply-templates select="(//error)[last()]" />
</xsl:template>
<xsl:template match="error">
<xsl:choose>
<xsl:when test="code='TechnicalError'">500</xsl:when>
<xsl:when test="code='TranslationError'">400</xsl:when>
<xsl:when test="code='ConfigurationError'">500</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,17 @@
<Forward name="success" path="WrapFo03Response"/>
</PutInSessionPipe>

<PutInSessionPipe name="BackEndError" unlessSessionKey="errorCode">
<Param name="errorCode" styleSheetName="Common/xsl/BackEndError.xsl"/>
<Param name="errorReason" xpathExpression="/error/reason"/>
<Param name="errorDetailText" xpathExpression="concat(/error/code, ' ', /error/reason, ' ', /error/details)"/>
<Param name="errorDetailXML" xpathExpression="/error/detailsXml" type="DOMDOC" />
<Forward name="success" path="WrapFo03Response"/>
<PutInSessionPipe
name="BackEndError"
unlessSessionKey="errorCode"
>
<Param name="errorCode" styleSheetName="Common/xsl/BackEndError.xsl" />
<Param name="errorReason" xpathExpression="(//error)[last()]/reason" />
<Param name="errorDetailText" xpathExpression="(//error)[last()]/details" />
<Param name="errorDetailXML" xpathExpression="/error" type="DOMDOC" />
<Forward name="success" path="WrapFo03Response" />
</PutInSessionPipe>

<SoapWrapperPipe
name="WrapFo03Response"
soapBodyStyleSheet="Common/xsl/CreateFo03Response.xslt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,15 @@
<Forward name="success" path="WrapFo03Response"/>
</PutInSessionPipe>

<PutInSessionPipe name="BackEndError" unlessSessionKey="errorCode">
<Param name="errorCode" styleSheetName="Common/xsl/BackEndError.xsl"/>
<Param name="errorReason" xpathExpression="/error/reason"/>
<Param name="errorDetailText" xpathExpression="concat(/error/code, ' ', /error/reason, ' ', /error/details)"/>
<Param name="errorDetailXML" xpathExpression="/error/detailsXml" type="DOMDOC" />
<Forward name="success" path="WrapFo03Response"/>
<PutInSessionPipe
name="BackEndError"
unlessSessionKey="errorCode"
>
<Param name="errorCode" styleSheetName="Common/xsl/BackEndError.xsl" />
<Param name="errorReason" xpathExpression="(//error)[last()]/reason" />
<Param name="errorDetailText" xpathExpression="(//error)[last()]/details" />
<Param name="errorDetailXML" xpathExpression="/error" type="DOMDOC" />
<Forward name="success" path="WrapFo03Response" />
</PutInSessionPipe>

<SoapWrapperPipe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,15 @@
<Forward name="success" path="WrapFo03Response"/>
</PutInSessionPipe>

<PutInSessionPipe name="BackEndError" unlessSessionKey="errorCode">
<Param name="errorCode" styleSheetName="Common/xsl/BackEndError.xsl"/>
<Param name="errorReason" xpathExpression="/error/reason"/>
<Param name="errorDetailText" xpathExpression="concat(/error/code, ' ', /error/reason, ' ', /error/details)"/>
<Param name="errorDetailXML" xpathExpression="/error/detailsXml" type="DOMDOC" />
<Forward name="success" path="WrapFo03Response"/>
<PutInSessionPipe
name="BackEndError"
unlessSessionKey="errorCode"
>
<Param name="errorCode" styleSheetName="Common/xsl/BackEndError.xsl" />
<Param name="errorReason" xpathExpression="(//error)[last()]/reason" />
<Param name="errorDetailText" xpathExpression="(//error)[last()]/details" />
<Param name="errorDetailXML" xpathExpression="/error" type="DOMDOC" />
<Forward name="success" path="WrapFo03Response" />
</PutInSessionPipe>

<SoapWrapperPipe
Expand Down

0 comments on commit c8c35a8

Please sign in to comment.