...
path:
intl-whitelabel-app/workspaces/frontend/src/utils/errors/index.ts
This method will be created to validate if the error is an RBI error, using the class RBIError2 which will renamed to RBIError in the future;.
Expand | |||||
---|---|---|---|---|---|
| |||||
|
extractRBIErrorCodes
path:
intl-whitelabel-app/workspaces/frontend/src/utils/errors/index.ts
As the error is DOMAIN.SEVERITY.CODE.ERROR, for the translation, it will be necessary to create a method to split the error and get the translation.
For example:
If the error is:
PAYMENT.2.102.001
, the split will return the array with:PAYMENT.2.102.001
PAYMENT.2.102
PAYMENT.2
PAYMENT
This array will be processed for the method
getRBIErrorTranslation
, which will be discussed in the below topic.OBS.: This method needs to add in the return a function
.reverse()
to translation correct because normally the.split()
will return an array:PAYMENT
,PAYMENT.2
,PAYMENT.2.102
,PAYMENT.2.102.001
, so thereverse
is necessary to get the translation of the most detailed (PAYMENT.2.102.001
) error to the least detailed (PAYMENT
).
...