Layer7 API Management

Expand all | Collapse all

Is it possible to use Raise error within Encapsulated Assertions?

Jump to Best Answer
  • 1.  Is it possible to use Raise error within Encapsulated Assertions?

    Posted 11-29-2017 04:04 AM

    I'm curieus if it is possible to use a Raise error assertion within Encapsulated Assertions. I've found out that a Policy Fragment containing a Raise error assertion behaves different then an Encapsulated Assertion based on this Policy Fragment.

    In other words. Within the Policy Fragment the Raise Error assertion is executed while this Raise error assertion is skipped within the Encapsulated Assertion.

    I cannot find any documentation about this behaviour in the docops and hope somebody recognises this behaviour.



  • 2.  Re: Is it possible to use Raise error within Encapsulated Assertions?

    Posted 11-29-2017 10:57 AM

    Hi Jan,

     

    The Raise Error assertion is supported within encapsulated assertions. When you say it is skipped, do you actually see lines of policy executing after the raise error assertion? Once it hits raise error it should stop policy execution unless you are using it with the handle error assertion. In this case policy execution continues outside this block.

     

    I have tested with 8.3 and 9.2 and see that it is indeed working as expected. Perhaps you can share a sample of where this is not working for my review.

     

    Regards,

    Joe



  • 3.  Re: Is it possible to use Raise error within Encapsulated Assertions?
    Best Answer

    Posted 12-01-2017 04:31 AM

    Hi JanvanDijk ,

     

    From the documentation

     

    Raise Error Assertion - CA API Gateway - 9.2 - CA Technologies Documentation 

     

    If used within a global policy or a encapsulated assertion context, be sure to use the Export Variables from Fragment Assertion to make the context variable available to the parent policy

     

    Regards

    Seenu Mathew



  • 4.  Re: Is it possible to use Raise error within Encapsulated Assertions?

    Posted 12-01-2017 07:47 AM

    Hello Seenu,

     

    Thanks for your reaction. The picture is clear now.

     

    Regards,

     

    Jan



  • 5.  Re: Is it possible to use Raise error within Encapsulated Assertions?

    Posted 12-07-2017 07:36 AM

    Dear Seenu,

     

    Seems Jan's problem is not with the Raise Error assertion. This is working as expected within encapsulated assertions.

    I did some investigation on his issue and found the Error Response is not as expected.

     

    Before the Raise Error assertion he call an encapsulated assertion which creates a Customized Error Response. It seems this is not set (in some cases) and the response is empty.

     

    Do you have any idea?

     

    Best regards,

     

    Remco Dekker

    Enable-U



  • 6.  Re: Is it possible to use Raise error within Encapsulated Assertions?

    Posted 12-01-2017 07:49 AM

    Hello Joe,

     

    Thanks for your reaction. I do understand how the cookie crumbles now.

     

    Regards,

     

    Jan