Message
API reference › CSV Export › exception › Message
Defines CSV export exception message templates.
Use Message::getMessage() to format the template with sprintf() arguments.
| Case | Value | Description |
|---|---|---|
ARCHIVER_RESULT_INVALID | 'The archiver must return a readable file in the private export directory.' | Error when the archiver returns a source CSV or a path that is not a readable file in the export directory. |
COLUMN_CLASS_INVALID | 'Every configured export column must extend Column.' | Error when a configured export column does not extend the base column class. |
COLUMN_EXPORTER_NOT_ASSIGNED | 'Assign the column to an exporter before rendering.' | Error when a column is rendered before it is assigned to an exporter. |
COLUMN_FORMAT_INVALID | 'The column must be specified in the format of "attribute", | Error when a column shortcut does not match the attribute:format:label format. |
COLUMN_ROW_INVALID | 'Reading a column attribute requires an array or object row.' | Error when a column attribute is read from a row that is neither an array nor an object. |
CSV_BOM_ENCODING_MISMATCH | 'The BOM must match the CSV output encoding.' | Error when the configured BOM does not match the CSV output encoding. |
CSV_CELL_INVALID | 'CSV cells must be scalar, | Error when a CSV cell value is neither scalar, null nor stringable. |
CSV_DIALECT_INVALID | 'Use distinct single-byte CSV delimiters and an LF, | Error when the CSV delimiters or the line ending are invalid. |
CSV_ENCODING_UNSUPPORTED | 'Choose UTF-8, | Error when the CSV output encoding is not supported. |
CSV_FINALIZE_FAILED | 'Unable to finalize CSV "%s".' | Error when the CSV stream cannot be flushed or released. |
CSV_NOT_OPEN | 'Open the CSV before writing.' | Error when content is written before the CSV stream is opened. |
CSV_NOT_WRITABLE | 'The CSV is no longer writable.' | Error when a closed or failed CSV is written to. |
CSV_OPEN_FAILED | 'Unable to open CSV "%s".' | Error when the CSV stream cannot be opened. |
CSV_SPREADSHEET_SAFE_REQUIRES_UTF8 | 'Spreadsheet-safe CSV requires UTF-8 text.' | Error when spreadsheet-safe escaping receives text that is not valid UTF-8. |
CSV_TRANSCODING_REQUIRES_UTF8 | 'Transcoding requires UTF-8 input.' | Error when transcoding receives content that is not valid UTF-8. |
CSV_UNQUOTED_CELL_INVALID | 'An unquoted cell cannot contain a delimiter or line break.' | Error when an unquoted CSV cell contains a delimiter or a line break. |
CSV_WRITE_INCOMPLETE | 'Unable to complete write to CSV "%s".' | Error when the CSV stream stops accepting bytes before the content is written. |
DATA_PROVIDER_KEYS_MISMATCH | 'The data provider must return one key for each model.' | Error when the data provider returns a different number of keys and models. |
DATA_SOURCE_NOT_CONFIGURED | 'Configure a data provider or a query before exporting.' | Error when neither a data provider nor a query is configured. |
DOWNLOAD_NAME_INVALID | 'Use a download name without path separators or control characters.' | Error when the download name is empty or contains path separators or control characters. |
EXPORT_BASE_NAME_INVALID | 'Use a simple file base name for the export.' | Error when the export file base name is not a simple file name. |
EXPORT_CSV_INVALID | 'The export contains a missing, | Error when the export contains a CSV that is missing, incomplete or outside the private export directory. |
EXPORT_DESTINATION_INSIDE_WORKSPACE | 'Deliver the export outside its private workspace.' | Error when the delivery destination is inside the private export directory. |
EXPORT_DESTINATION_PREPARE_FAILED | 'Unable to prepare the destination for the export.' | Error when the delivery destination directory cannot be prepared. |
EXPORT_DIRECTORY_ALREADY_ALLOCATED | 'The private export directory is already allocated.' | Error when the parent directory is set after the private export directory is allocated. |
EXPORT_DIRECTORY_CREATE_FAILED | 'Unable to create a private export directory.' | Error when the private export directory cannot be created. |
EXPORT_DIRECTORY_IDENTIFY_FAILED | 'Unable to identify the private export directory.' | Error when the identity of the private export directory cannot be read. |
EXPORT_DIRECTORY_REMOVE_FAILED | 'Unable to remove the private export directory.' | Error when the private export directory remains after cleanup. |
EXPORT_LEASE_CREATE_FAILED | 'Unable to create the export lease.' | Error when the export lease file cannot be created. |
EXPORT_PARENT_DIRECTORY_READ_FAILED | 'Unable to read the export parent directory.' | Error when the export parent directory cannot be listed. |
EXPORT_RETENTION_NOT_POSITIVE | 'Export retention must be positive.' | Error when the export retention age is not positive. |
EXPORT_STAGE_FAILED | 'Unable to stage the export.' | Error when the staging file for the export cannot be created. |
EXPORT_STAGE_OUTSIDE_DESTINATION | 'Unable to stage the export beside its destination.' | Error when the staging file is created outside the destination directory. |
EXPORT_WORKSPACE_LOCK_FAILED | 'Unable to lock the export workspace.' | Error when the export workspace cannot be locked. |
EXPORT_WORKSPACE_PREPARE_FAILED | 'Unable to prepare the export workspace.' | Error when the export base directory cannot be created or resolved. |
FILE_ROW_LIMIT_TOO_SMALL | 'The file limit must fit the header, | Error when the per-file row limit cannot fit the header, footer and one data row. |
FORMATTER_NOT_CONFIGURED | 'Configure a Yii formatter before exporting formatted data.' | Error when formatted data is exported without a Yii application formatter. |
INFERRED_COLUMN_NAME_INVALID | 'Inferred column names must be strings or integers.' | Error when an inferred column name is neither a string nor an integer. |
PAGINATION_NOT_CLONED | 'A custom data provider must clone its pagination for export.' | Error when a custom data provider returns its own pagination instead of a clone. |
QUERY_BATCH_ROWS_NOT_ITERABLE | 'Each query batch must contain iterable rows.' | Error when a query batch is not iterable. |
QUERY_BATCH_SIZE_NOT_POSITIVE | 'The query batch size must be positive.' | Error when the query batch size is not positive. |
QUERY_BATCHES_NOT_ITERABLE | 'The query must return iterable batches.' | Error when the query batch method does not return an iterable. |
RESULT_CLASS_INVALID | 'The configured result must extend ExportResult.' | Error when the configured result class does not extend the export result class. |
SEND_REQUIRES_WEB_RESPONSE | 'Sending a CSV requires a Yii web response.' | Error when a completed export is sent without a Yii web application. |
SEND_RESULT_MISSING | 'There is no completed export to send.' | Error when there is no completed export to send. |
WRITER_CLASS_INVALID | 'The configured writer must extend CsvFile.' | Error when the configured writer class does not extend the CSV writer class. |
ZIP_ADD_MEMBER_FAILED | 'Unable to add a member to the export ZIP.' | Error when a member cannot be added to the export ZIP. |
ZIP_EXTENSION_MISSING | 'Install ext-zip or configure an export archiver.' | Error when neither ext-zip nor a custom export archiver is available. |
ZIP_FINALIZE_FAILED | 'Unable to finalize the export ZIP.' | Error when the export ZIP cannot be closed. |
ZIP_OPEN_FAILED | 'Unable to open the export ZIP.' | Error when the export ZIP cannot be opened. |
ZIP_PUBLISH_FAILED | 'Unable to publish the completed export ZIP.' | Error when the staged export ZIP cannot be moved to its final path. |
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