> ## Documentation Index
> Fetch the complete documentation index at: https://primer.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# PrimerValidationError

Representing a Primer Validation Error.
External input to our components will always undergo data validation to ensure accuracy and reliability.

```swift SWIFT theme={"dark"}
public enum PrimerValidationError: PrimerErrorProtocol, Encodable {
    var errorId: String { get }
    var errorDescription: String { get }
    var errorUserInfo: [String: Any]? { get }
    var diagnosticsId: String { get }
}
```

## Properties

<Expandable title="Properties" defaultOpen>
  <ResponseField name="errorId" type="String" required>
    A unique error identifier.
  </ResponseField>

  <ResponseField name="description" type="String" required>
    A error description.
  </ResponseField>

  <ResponseField name="diagnosticsId" type="String" required>
    A unique diagnostics id for the given error.
  </ResponseField>
</Expandable>

## Exposed Error IDs

### Payment Component Errors

#### Klarna Component

| Error ID                    | Description                                                           |
| --------------------------- | --------------------------------------------------------------------- |
| `session-not-created`       | Session needs to be created before payment category can be collected. |
| `invalid-payment-category`  | Payment category is invalid.                                          |
| `payment-already-finalized` | This payment was configured to finalize  automatically.               |

#### Banks Component

| Error ID           | Description                                              |
| ------------------ | -------------------------------------------------------- |
| `banks-not-loaded` | Banks need to be loaded before bank id can be collected. |
| `invalid-bank-id`  | Bank id doesn't belong to any of the supported banks.    |

#### nol Pay Components

| Error ID               | Description                   |
| ---------------------- | ----------------------------- |
| `invalid-otp-code`     | OTP code is not valid.        |
| `invalid-phone-number` | Failed to parse phone number. |
| `invalid-card-number`  | Card number cannot be blank.  |
