# Message

> Represents error message templates for exceptions thrown by the extension.

[API reference](/docs/api/index.md) › [FilePond](/docs/extensions/filepond/reference/index.md) › [exception](/docs/extensions/filepond/reference/exception/index.md) › Message

| enum | `yii2\extensions\filepond\exception\Message` |
| --- | --- |
| Backed by | `string` |
| Source | [`src/exception/Message.php`](https://github.com/yii2-extensions/filepond/blob/main/src/exception/Message.php#L14) |

Represents error message templates for exceptions thrown by the extension.

Use [`Message::getMessage()`](/docs/extensions/filepond/reference/exception/message/index.md#method-getMessage) to format a template with `sprintf()` arguments.

## Cases

| Case | Value | Description |
| --- | --- | --- |
| <span id="case-CROPPER_REQUIRES_IMAGE_EDIT"></span>`CROPPER_REQUIRES_IMAGE_EDIT` | `"The 'cropper' options require 'allowImageEdit' to be enabled."` | Error when cropper options are configured without enabling the Image Edit plugin. |
| <span id="case-DIRECTORY_NOT_WRITABLE"></span>`DIRECTORY_NOT_WRITABLE` | `"Directory '%s' is not writable."` | Error when the target directory cannot be created or written to. |
| <span id="case-ENCODED_FILE_INVALID_BASE64"></span>`ENCODED_FILE_INVALID_BASE64` | `"Encoded file 'data' is not valid base64."` | Error when the `data` key of an encoded file is not valid base64. |
| <span id="case-ENCODED_FILE_INVALID_JSON"></span>`ENCODED_FILE_INVALID_JSON` | `"Encoded file payload is not valid JSON: '%s'."` | Error when an encoded file payload cannot be decoded as JSON. |
| <span id="case-ENCODED_FILE_INVALID_KEY"></span>`ENCODED_FILE_INVALID_KEY` | `"Encoded file key '%s' must be of type '%s'."` | Error when a required key of an encoded file has an unexpected type. |
| <span id="case-ENCODED_FILE_INVALID_PAYLOAD"></span>`ENCODED_FILE_INVALID_PAYLOAD` | `"Encoded file payload must be a JSON object or an array; received '%s'."` | Error when an encoded file payload is neither a JSON object nor an array. |
| <span id="case-FILE_WRITE_FAILED"></span>`FILE_WRITE_FAILED` | `"Unable to write file '%s'."` | Error when a file cannot be written to disk. |
| <span id="case-GD_EXTENSION_REQUIRED"></span>`GD_EXTENSION_REQUIRED` | `"The 'gd' extension is required for server-side image cropping."` | Error when server-side cropping is requested without the GD extension. |
| <span id="case-IMAGE_BYTE_LIMIT_EXCEEDED"></span>`IMAGE_BYTE_LIMIT_EXCEEDED` | `"Image '%s' exceeds the input byte limit of %d."` | Error when source bytes exceed the processing budget before header parsing. |
| <span id="case-IMAGE_DECODE_FAILED"></span>`IMAGE_DECODE_FAILED` | `"Unable to decode image data of file '%s'."` | Error when image data cannot be decoded by GD. |
| <span id="case-IMAGE_DIMENSION_LIMIT_EXCEEDED"></span>`IMAGE_DIMENSION_LIMIT_EXCEEDED` | `"Image '%s' exceeds the source dimension limit of %d."` | Error when either source axis exceeds the processing budget. |
| <span id="case-IMAGE_ENCODE_FAILED"></span>`IMAGE_ENCODE_FAILED` | `"Unable to encode image data of file '%s' as '%s'."` | Error when a cropped image cannot be encoded to the requested MIME type. |
| <span id="case-IMAGE_PIXEL_LIMIT_EXCEEDED"></span>`IMAGE_PIXEL_LIMIT_EXCEEDED` | `"Image '%s' exceeds the source pixel limit of %d."` | Error when source area exceeds the processing budget before decoding. |
| <span id="case-INVALID_CROP_ASPECT_RATIO"></span>`INVALID_CROP_ASPECT_RATIO` | `"Crop aspect ratio must use the 'width:height' format with positive numbers; " . "received '%s'."` | Error when a crop aspect ratio does not follow the `width:height` format. |
| <span id="case-INVALID_IMAGE_PROCESSING_LIMIT"></span>`INVALID_IMAGE_PROCESSING_LIMIT` | `"Image processing limit '%s' must be a positive integer."` | Error when a required image-processing budget is zero or negative. |
| <span id="case-PACKAGE_VERSION_UNAVAILABLE"></span>`PACKAGE_VERSION_UNAVAILABLE` | `"Unable to read the version of npm package '%s' from '%s'."` | Error when the version of an npm package cannot be read for CDN delivery. |

## 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.