Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Error Handling in Applications

Error handling is critical aspect of developing applications in any programming language. Error handling is a mechanism where applications can notify error conditions to end users. A-Stack is a collection of number of atomic domain languages, the error handling varies based on language the application is using. Error handling in A-Stack can be classified into three broad categories -

  • Error handling in NewFacetInstances
  • Error handling as part of process code in non-workflow definition language.
  • Error handling in Workflow Definition Language

Trapping Errors in NewFacetInstances

A-Stack provides <OnError> event as part of Facet life-cycle which can be used 

Trapping Errors in Queries

All TQL exceptions are caught by the TQL facet itself and reported in query/attribute status. TQL exceptions are not passed to error handler and instead we should check the status instead. In the example below we check for Find status value and make changes to the response. 

Step to Check for Find Status is:

Error Handling in Queries
<If Condition="$Response.Message.Value.Find/Status eq 'Error'">
</If>
Error Handling in Queries
<Query>
  <Find Format="Version">
    <VendorInfo1>
      <vendorId>
        <NE>
        </NE>
      </vendorId>
    </VendorInfo1>
  </Find>
  <If Condition="$Response.Message.Value.Find/Status eq 'Error'">
    <Then>
      <AddResponseData>
        <Key>
          Message.Value.Error.Message
        </Key>
        <Value>
          [:$Response.Message.Value.Find.Error:]
        </Value>
      </AddResponseData>
      <AddResponseData>
        <Key>
          Message.Value.Error.Code
        </Key>
        <Value>
          1002
        </Value>
      </AddResponseData>
      <SetResponseData>
        <Key>
          Message.Value.Find
        </Key>
        <Value>
        </Value>
      </SetResponseData>
    </Then>
  </If>
</Query>



  • No labels