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.
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.
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
Thanks for your reaction. The picture is clear now.
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?
Thanks for your reaction. I do understand how the cookie crumbles now.