---
schema_version: "1"
id: a844fd3ce281a3e94259d156b0931dd3e4e54c45c475c3a439f7a9e1d72edf9d
title: Fail Securely
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/cc/264-0-0/b2c_fail_securely.md
canonical_url: https://help.salesforce.com/s/articleView?id=cc.b2c_fail_securely.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 58b377abc0442e9884fa64122bab4cbc596e5db55bb210e56759cc30d02abd1d
description: Fail securely means implementing decision logic that puts B2C Commerce systems into a secure state when errors occur. Handling errors securely ensures that the error path, such as exceptions, doesn’t disclose additional information that wouldn’t be available otherwise. Attackers can use this additional information to learn how to attack the system.
products:
  - Commerce
  - B2C Commerce
release: "264"
---
# Fail Securely

Fail securely means implementing decision logic that puts B2C Commerce systems into a secure state when errors occur. Handling errors securely ensures that the error path, such as exceptions, doesn’t disclose additional information that wouldn’t be available otherwise. Attackers can use this additional information to learn how to attack the system.

Here are some best practices.

- Don't use an error message that discloses information about the web server configuration because it can help an attacker identify potential weaknesses.
- Use a generic “username or passphrase is invalid” message instead of “username not found” or “password is incorrect” to prevent user enumeration.