Skip to content

Conversation

@eplazaso
Copy link
Contributor

@eplazaso eplazaso commented Jan 8, 2026

No description provided.

response: Response
): Response {
if (
[400, 401, 403, 404, 405, 408, 429, 500, 502, 504, 901].includes(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the codes from here: https://developers.liveperson.com/liveperson-functions-foundations-error-codes.html#error-codes , Can be that not in all returns the error "code-message" format, but it wont hurt since we check here isV2ErrorBody() the type

@eplazaso
Copy link
Contributor Author

eplazaso commented Jan 8, 2026

Unit tests are passing locally
image

return domain.includes('fninvocations') || domain.includes('functions');
}

private transfornReponseErrorForV1Compatibility(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private transfornReponseErrorForV1Compatibility(
private transformReponseErrorForV1Compatibility(

private transfornReponseErrorForV1Compatibility(
response: Response
): Response {
if (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest this feels unnecessary complicated and leaves room for errors. Probably the easiest is to check if the body has properties code + message and is a non successful call and then you can map it.

This we you can also make a fast exit for success responses.

# run on all supported LTS versions and the latest/current version
node-version: [14, 16, 18, latest]
# run on all supported LTS versions and the latest lts version
node-version: [14, 16, 18, 22, 'lts/*']
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are versions included that are no longer officially supported. Hence we should reduce either to 18, 22, lts or 22 & lts

Suggested change
node-version: [14, 16, 18, 22, 'lts/*']
node-version: [18, 22, 'lts/*']

});
}
});

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be a test case that shows that a response (success) with code & message would not be adjusted. Highlighting the behaviour that we don't interfere with successful customer responses.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New test added L166

@LivePersonFaas LivePersonFaas merged commit ea0af35 into LivePersonInc:master Jan 8, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants