How to use the @airbnb/lunar/lib/components/ErrorMessage.getErrorMessage function in @airbnb/lunar

To help you get started, we’ve selected a few @airbnb/lunar examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github airbnb / lunar / packages / forms / src / components / Form / index.tsx View on Github external
return promise.catch(error => {
      if (setErrors) {
        setErrors({
          [FORM_ERROR]: T.phrase(
            'Failed to submit form. %{error}',
            {
              error: getErrorMessage(error),
            },
            {
              context: 'A generic error when a form failed to submit',
              key: 'lunar.form.submitFailed',
            },
          ),
        });
      }

      this.props.onFailedSubmit!(preparedData, error);

      throw error;
    });
  };