> ## Documentation Index
> Fetch the complete documentation index at: https://docs-staging-quickstart-revamp.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Customizing error messages with Lock

# Customize Lock Error Messages

You can customize the error messages that will be displayed in certain situations by providing a `languageDictionary` option. A full listing of available `languageDictionary` fields to customize can be found in the GitHub repository's [English Dictionary file for Lock](https://github.com/auth0/lock/blob/master/src/i18n/en.js). Below is an example of some customized error messages:

{/* codeblockOld.header.login.logInButton codeblockOld.header.login.configureSnippet */}

```javascript lines
// Examples of customized error messages in the languageDictionary option
var options = {
  languageDictionary: {
    error: {
      login: {
        "lock.invalid_email_password": "Custom message about invalid credentials",
        "lock.network": "Custom message indicating a network error and suggesting the user check connection",
        "lock.unauthorized": "Custom message about a failure of permissions",
        "too_many_attempts": "Custom message indicating the user has failed to login too many times."
      },
      signUp: {
        "invalid_password": "Custom message indicating a password was invalid",
        "user_exists": "Custom message indicating that a user already exists"
      }
    }
  }
};

// Initiating our Auth0Lock
var lock = new Auth0Lock(
  '{yourClientId}',
  '{yourDomain}',
  options
);
```

## Custom errors in Rules

If you are returning custom error codes from a [rule](/docs/customize/rules) or a custom database script, you can handle custom errors:

* In your application's redirect URL by reading the `error` and `error_mesage` query string parameters.
* By redirecting the user back to your hosted pages with a custom error message and displaying the message with a [flash message](/docs/libraries/lock/lock-api-reference).

## Learn more

* [Lock for Web](/docs/libraries/lock)
