In Controller/[filename].js , there is a catch block that catches if there is any exception thrown in any internal flow of the services.
In all services, the catch block is commonly made the response-code as "INTERNAL_SERVER_ERROR" which would give 500 response code irrespective of the error. The error may be because of wrong input or something not supported or internal-server-error.
proposal:
We need to analyze possible response codes for all services (both in AP and in all individual applications) and update the response block for error condition.
In Controller/[filename].js , there is a catch block that catches if there is any exception thrown in any internal flow of the services. In all services, the catch block is commonly made the response-code as "INTERNAL_SERVER_ERROR" which would give 500 response code irrespective of the error. The error may be because of wrong input or something not supported or internal-server-error.
}) .catch(async function (responseBody) { responseBodyToDocument = responseBody; responseCode = responseCodeEnum.code.INTERNAL_SERVER_ERROR; let responseHeader = await restResponseHeader.createResponseHeader(xCorrelator, startTime, req.url); restResponseBuilder.buildResponse(res, responseCode, responseBody, responseHeader); });
proposal: We need to analyze possible response codes for all services (both in AP and in all individual applications) and update the response block for error condition.