API Connect

API Connect

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  API Catch VS Error Global Policy Catch: apim.getError();

    Posted Sun April 30, 2023 08:47 AM

    We have an issue and we do not know if it's by design. When we log apim.getError() in an API's catch and we can check "policyTitle" indicating the policy causing an error as following:

    "Message": {
         "name": "JavaScriptError",
         "message": "Internal Error",
         "status": {
             "code": 500,
             "reason": "Internal Server Error"
          },
          "policyTitle": "Check framework validation code"
    }

    But when we migrated the catch to the error global policy, now it's null.

    "Message": {
         "name": "JavaScriptError",
         "message": "Internal Error",
         "status": {
             "code": 500,
             "reason": "Internal Server Error"
          },
          "policyTitle": null
    }

    How can I get the same behavior in the error global policy catch?



    ------------------------------
    Mohamed Alkhaligy
    ------------------------------


  • 2.  RE: API Catch VS Error Global Policy Catch: apim.getError();

    Posted Sat August 26, 2023 10:54 AM

    Update: I found a workaround for this problem long ago, but I wanted to confirm if this behavior is from IBM's APIC by design. Is "policyTitle" always set to null in the error global policy (Maybe to avoid confusing identical policy titles from different sources; pre-request global policy, assembly flow, or post-response global policy?!)?

    I am assuming this because any error caught in a catch from a policy in either pre-request global policy, assembly flow, or post-response global policy contains a non-null value in "policyTitle" but not when caught in the error global policy.

    Can you @Steve Linn or any of the APIC team confirm?



    ------------------------------
    Mohamed Alkhaligy
    ------------------------------



  • 3.  RE: API Catch VS Error Global Policy Catch: apim.getError();

    Posted Tue August 29, 2023 02:25 PM

    Hi Mohamed,
    I'll need to check with the developer knowledgeable with that area of the code.  I can't think of any reason why the policy title string would be lost but the rest of the error object is unchanged, so this may be a product issue.  I'll hopefully get some more information soon, but I'd suggest you open a PMR to get a more official answer.
    Best Regards,
    Steve Linn



    ------------------------------
    Steve Linn
    Senior Consulting I/T Specialist
    IBM
    ------------------------------



  • 4.  RE: API Catch VS Error Global Policy Catch: apim.getError();

    Posted Wed August 30, 2023 08:54 AM

    Hi Mohamed,
    The developer I reached out to has confirmed this is a product defect.  Please open a PMR.
    Best Regards,

    Steve Linn



    ------------------------------
    Steve Linn
    Senior Consulting I/T Specialist
    IBM
    ------------------------------