Tech debt: Use permanent error key instead of error message

Description

In some places we use error messages which we get from backend to choose translation id on frontend side. For example like this:

 

if (backendErrorMessage === 'Could not find user with matching barcode') {     return (           <FormattedMessage               id="ui-checkout.messages.userHasNoBarcode"           />     ) }

 

It is not good approach because if backend error message changes our code will stop working correctly.

 

We discussed this issue with backend. They will send us error messages and error keys. Backend error messages can change but error key will never change.

 

When backend adds error keys we have to use them instead of error message on frontend side.

Environment

None

Potential Workaround

None

Checklist

hide

TestRail: Results

Activity

Show:
Done

Details

Assignee

Reporter

Priority

Story Points

Sprint

Development Team

Vega

Fix versions

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created June 2, 2022 at 9:25 AM
Updated June 24, 2022 at 1:12 PM
Resolved June 24, 2022 at 9:15 AM
TestRail: Cases
TestRail: Runs

Flag notifications