Message
API reference › FilePond › exception › Message
Represents error message templates for exceptions thrown by the extension.
Use Message::getMessage() to format a template with sprintf() arguments.
| Case | Value | Description |
|---|---|---|
CROPPER_REQUIRES_IMAGE_EDIT | "The 'cropper' options require 'allowImageEdit' to be enabled." | Error when cropper options are configured without enabling the Image Edit plugin. |
DIRECTORY_NOT_WRITABLE | "Directory '%s' is not writable." | Error when the target directory cannot be created or written to. |
ENCODED_FILE_INVALID_BASE64 | "Encoded file 'data' is not valid base64." | Error when the data key of an encoded file is not valid base64. |
ENCODED_FILE_INVALID_JSON | "Encoded file payload is not valid JSON: '%s'." | Error when an encoded file payload cannot be decoded as JSON. |
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. |
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. |
FILE_WRITE_FAILED | "Unable to write file '%s'." | Error when a file cannot be written to disk. |
GD_EXTENSION_REQUIRED | "The 'gd' extension is required for server-side image cropping." | Error when server-side cropping is requested without the GD extension. |
IMAGE_BYTE_LIMIT_EXCEEDED | "Image '%s' exceeds the input byte limit of %d." | Error when source bytes exceed the processing budget before header parsing. |
IMAGE_DECODE_FAILED | "Unable to decode image data of file '%s'." | Error when image data cannot be decoded by GD. |
IMAGE_DIMENSION_LIMIT_EXCEEDED | "Image '%s' exceeds the source dimension limit of %d." | Error when either source axis exceeds the processing budget. |
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. |
IMAGE_PIXEL_LIMIT_EXCEEDED | "Image '%s' exceeds the source pixel limit of %d." | Error when source area exceeds the processing budget before decoding. |
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. |
INVALID_IMAGE_PROCESSING_LIMIT | "Image processing limit '%s' must be a positive integer." | Error when a required image-processing budget is zero or negative. |
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
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
getMessage() | Returns the formatted message string for the error case. | Message |
Method details
Section titled “Method details”getMessage()
Section titled “getMessage() ”public function getMessage(int|string ...$argument): stringReturns the formatted message string for the error case.
Parameters
| Parameter | Type | Description |
|---|---|---|
...$argument | int| | Values to insert into the message template. |
Returns
string: Formatted error message with interpolated arguments.