# Message

> Represents error message templates for attribute exceptions.

[API reference](/docs/api/index.md) › [HTML Attribute](/docs/extensions/html-attribute/reference/index.md) › [Exception](/docs/extensions/html-attribute/reference/exception/index.md) › Message

| enum | `UIAwesome\Html\Attribute\Exception\Message` |
| --- | --- |
| Backed by | `string` |
| Source | [`src/Exception/Message.php`](https://github.com/ui-awesome/html-attribute/blob/main/src/Exception/Message.php#L14) |

Represents error message templates for attribute exceptions.

Use [`Message::getMessage()`](/docs/extensions/html-attribute/reference/exception/message/index.md#method-getMessage) to format the template with [`sprintf()`](https://www.php.net/manual/en/function.sprintf.php) arguments.

## Cases

| Case | Value | Description |
| --- | --- | --- |
| <span id="case-ATTRIBUTE_INVALID_VALUE"></span>`ATTRIBUTE_INVALID_VALUE` | `"Invalid value '%s' for attribute '%s'. Expected: '%s'."` | Error when an attribute value is invalid. |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`getMessage()`](#method-getMessage) | Returns the formatted message string for the error case. | `Message` |

## Method details

### getMessage() <span id="method-getMessage"></span>

```php
public function getMessage(int|string ...$argument): string
```

Returns the formatted message string for the error case.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `...$argument` | `int\|string` | Values to insert into the message template. |

**Returns**

`string`: Formatted error message with interpolated arguments.