Parses policy errors and generates human readable error messages.
The step containing the error.
Extensible and overridable custom error messages for policy failures.
Array of objects containing all processed policy errors.
Parses a failed policy and returns a string array of error messages.
The detail data of the failed policy.
Array of strings with all processed policy errors.
Parses a policy error into a human readable error message.
The property with the policy failure.
The policy failure data.
Human readable error message.
Utility for processing policy failures into human readable messages.
Example:
// Create message overrides and extensions as needed const messageCreator = { [PolicyKey.unique]: (property: string) => ( `this is a custom message for "UNIQUE" policy of ${property}` ), CUSTOM_POLICY: (property: string, params: any) => ( `this is a custom message for "${params.policyRequirement}" policy of ${property}` ), }; const thisStep = await FRAuth.next(previousStep); if (thisStep.type === StepType.LoginFailure) { const messagesStepMethod = thisStep.getProcessedMessage(messageCreator); const messagesClassMethod = FRPolicy.parseErrors(thisStep, messageCreator) }