E9.2 How to make a SREQ return better error messages

JohnDanter2

JohnDanter2

VIP Member
Hi folks,

Bit of a tricky one here. In escence I want to try and get more error info out of my ORCH using an SREQ recording than I am currently getting
I am missing these 2 key values in the SREQ response that are present if I call the same BSFN in an ORCH that uses a function call
"fileName": "n55apird.c",
"lineNumber": 218

I've written a simple NER N55APIRD which I can call in various modes to throw errors/warnings etc and wrapped this in a simple ORCH that just executes the Custom Request f(X) to try and better learn the JSON response for future external consuming devices . Job done, I am all over that :) see here (https://www.jdelist.com/community/t...-line-error-ouput-response.58279/#post-204638)

But then I wanted to learn how Form Request recordings work and handle errors so I wrote a very simple screen P55APIRD to call the same N55APIRD with the same input parameters used above and I used a recorded SREQ and also wrapped that up in an ORCH, this time obviously calling the SREQ rather a straight out BSFN request call
If I call an ORCH that calls N55APIRD directly I get back great error infomation in the JSON saying the error code, the object name, line number and glossary text. Great!

Example of BSFN ORCH response with invalid address book
Code:
{
    "ServiceRequest1": {
        "szerror": "0037",
        "errorLevel": 1,
        "alphaDescription": "Error: Address Number - Invalid",
        "glossaryText": "CAUSE . . . .  The address number entered is not found in the Address Book\n               Master file (F0101).\nRESOLUTION. .  Enter a valid address number.\n",
        "fileName": "n55apird.c",
        "lineNumber": 218
    },
    "continuedOnError": [
        {
            "step": "RRD_N55APIRD_BSFN",
            "message": {
                "RRD_N55APIRD_BSFN": {
                    "szerror": "0037",
                    "errorLevel": 1,
                    "alphaDescription": "Error: Address Number - Invalid",
                    "glossaryText": "CAUSE . . . .  The address number entered is not found in the Address Book\n               Master file (F0101).\nRESOLUTION. .  Enter a valid address number.\n",
                    "fileName": "n55apird.c",
                    "lineNumber": 218
                }
            },
            "timeStamp": "2023-03-21T11:34:03.350-0500",
            "userDefinedErrorText": ""
        }
    ],
    "scsResult": "200003",
    "scsInfo": "D: Error: Address Number - Invalid O: n55apird.c E: 0037 L: 218",
    "szSourceResultField": 200003,
    "jde__simpleMessage": "I worked but had a warning"
}

but..................Now if I call the exact same BSFN but executed from my SREQ rather than directly for the same error I get this response, which is not as informative as I lose object and line # (which is invaluable for fault finding)

Code:
{
  "ServiceRequest1": {
    "fs_P55APIRD_W55APIRDA": {
      "title": "RRD API R&D",
      "data": {
        "z_DSC1_30": {
          "title": "Description",
          "value": " "
        },
        "z_DSC2_32": {
          "title": "Description - Line 2",
          "value": " "
        }
      },
      "errors": [
        {
          "CODE": "0037",
          "TITLE": "Error: Address Number - Invalid",
          "ERRORCONTROL": "0",
          "DESC": "CAUSE . . . .  The address number entered is not found in the Address Book\\u000a               Master file (F0101).\\u000aRESOLUTION. .  Enter a valid address number.",
          "MOBILE": "The address number entered is not found in the Address Book\\u000a               Master file (F0101)."
        }
      ],
      "warnings": []
    },
    "stackId": 38,
    "stateId": 1,
    "rid": "97f2a6baca8af3d9",
    "currentApp": "P55APIRD_W55APIRDA",
    "timeStamp": "2023-03-21:11.35.03",
    "sysErrors": []
  },
  "Errors/Warnings": [
    {
      "Application ID": "P55APIRD_W55APIRDA",
      "Title": "RRD API R&D",
      "Errors": [
        {
          "CODE": "0037",
          "TITLE": "Error: Address Number - Invalid",
          "ERRORCONTROL": "0",
          "DESC": "CAUSE . . . .  The address number entered is not found in the Address Book\\u000a               Master file (F0101).\\u000aRESOLUTION. .  Enter a valid address number.",
          "MOBILE": "The address number entered is not found in the Address Book\\u000a               Master file (F0101)."
        }
      ],
      "Warnings": []
    }
  ],
  "continuedOnError": [
    {
      "step": "RRD_SREQ_P55APIRD_FI",
      "message": "RRD_SREQ_P55APIRD_FI:\n(1) Code-Control: 0037-0, Title: Error: Address Number - Invalid,  Description: The address number entered is not found in the Address Book Master file (F0101). \n",
      "timeStamp": "2023-03-21T11:35:03.436-0500",
      "userDefinedErrorText": "",
      "type": "application"
    }
  ],
  "jde__simpleMessage": "Errors/Warnings\n(1) Code-Control: 0037-0, Title: Error: Address Number - Invalid,  Description: The address number entered is not found in the Address Book Master file (F0101). \n\n\nContinued on Error\n1 - RRD_SREQ_P55APIRD_FI:\n(1) Code-Control: 0037-0, Title: Error: Address Number - Invalid,  Description: The address number entered is not found in the Address Book Master file (F0101).",
  "jde__status": "WARN",
  "jde__startTimestamp": "2023-03-21T11:35:03.267-0500",
  "jde__endTimestamp": "2023-03-21T11:35:03.437-0500",
  "jde__serverExecutionSeconds": 0.17
}

As you can see the only info coming back in way of errors is the errors alpha descrption Error: Address Number - Invalid and the code 0037
So my question is, does anyone know a way of getting back all the good stuff you see in screen errors back into the JSON repsonse from a forms recorded SREQ, as below


P55APIRD.JPG

Thanks

John
 
Last edited:
Back
Top