0% found this document useful (0 votes)
2 views

2 - APIM - Development - Policy Studio - Lab - Error management

The document outlines a presentation on error management in Policy Studio, focusing on practical applications and solutions for handling errors in Billing REST and SOAP services. It details the creation of error attributes, setting up fault handlers, and emphasizes the importance of accurate error management in API policy. The presentation concludes with a reminder to consider error management from the beginning of implementation.

Uploaded by

Lauro Ramazzini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

2 - APIM - Development - Policy Studio - Lab - Error management

The document outlines a presentation on error management in Policy Studio, focusing on practical applications and solutions for handling errors in Billing REST and SOAP services. It details the creation of error attributes, setting up fault handlers, and emphasizes the importance of accurate error management in API policy. The presentation concludes with a reminder to consider error management from the beginning of implementation.

Uploaded by

Lauro Ramazzini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

AMPLIFY API MANAGEMENT

Policy Studio –Lab


Error management

#axway
Welcome To Our Presentation
Policy Studio - Lab - Error management

Our Goals • Put theory into practice after Error management Policy
Studio module

• Learn how to catch/handle errors correctly

2
Welcome To Our Presentation
Policy Studio - Lab - Error management

Agenda Practice : error management


Solution

3
Practice : error
management

4
Billing REST error management
• Only correct processing is done in restified service Billing

• Let’s add minimum error management to this service

5
Billing SOAP Service
Error management
Company boundaries

Shipping Shipping
Partner Mockup
Billing
Consumers

OMS
REST
API Management Developer
Infrastructure
Error : wrong parameter
6
Solution

7
Default Error attributes
• Go to BillingRest policy

• Add “Copy / Modify attributes” filter in the policy


• See following pictures for options

• Create 2 attributes
• error.message Request failed
• error.http.code 500

• Then link it at begining of the policy and set start

8
Default Error attributes

9
Validation Error attributes
• Add another “Copy / Modify
attributes” (or copy it)

• Set name “ERROR: validation”

• Create 2 attributes
• error.message Validation
failed
• error.http.code 500

• Then link it at “Validation Rest filter”

10
Connection Error attributes
• Add another “Copy / Modify
attributes” (or copy it)

• Set name “ERROR: connection”

• Create 2 attributes
• error.message :
Service not available
• error.http.code : 500

• Then link it at “Connect to URL”

11
False filter
• Add a “False” filter

• Link previous “ERROR”


named filters to it

12
Set Error message
• Create a new policy “BillingRestFaultHandler” in same container

• Add a “Set Message” with application/json :


{
“id”: “${id}”,
“message”: “${error.message}”
}
• Add a “Reflect Message” with ${error.http.code}

• Set start

13
Fault Handler
• Add “BillingRestFaultHandler” in
“BillingRest”

• Set “BillingRestFaultHandler” as
Fault Handler (right-click on it)

• Test it!

14
Test

15
Remarks
• Notice there are still some filters having “End” tag
• So default error notification will be triggered

• “Connect to URL” failure path will be triggered only if service cannot be reached,
not for http code different of 200

• Adding accurate error management can be an important part of policy size (like
in any program)

16
Wrap-up

17
Wrap-up
• Of course, implementation starts by doing something working
• But there often few correct paths, for many incorrect. Take care of this topic
from the beginning
• Leverage Failure path, Fault Handler and Transaction Audit to take care of it

18
Thank you!

19

You might also like