processingError example

'message' => 'Access to file denied due to invalid access token',
        ];

        yield 'CONTENT__IMPORT_EXPORT_FILE_NOT_FOUND' => [
            'exception' => ImportExportException::fileNotFound('notFoundFile'),
            'statusCode' => Response::HTTP_NOT_FOUND,
            'errorCode' => 'CONTENT__IMPORT_EXPORT_FILE_NOT_FOUND',
            'message' => 'Cannot find import/export file with id notFoundFile',
        ];

        yield 'CONTENT__IMPORT_EXPORT_PROCESSING_EXCEPTION' => [
            'exception' => ImportExportException::processingError('Cannot merge file'),
            'statusCode' => Response::HTTP_INTERNAL_SERVER_ERROR,
            'errorCode' => 'CONTENT__IMPORT_EXPORT_PROCESSING_EXCEPTION',
            'message' => 'Cannot merge file',
        ];

        yield 'CONTENT__IMPORT_EXPORT_REQUIRED_BY_USER' => [
            'exception' => ImportExportException::requiredByUser('foo'),
            'statusCode' => Response::HTTP_BAD_REQUEST,
            'errorCode' => 'CONTENT__IMPORT_EXPORT_REQUIRED_BY_USER',
            'message' => 'foo is set to required by the user but has no value',
        ];
    }
$partFiles[] = $meta->path();
        }

        // sort by offset         natsort($partFiles);

        // concatenate all part files into a temporary file         foreach ($partFiles as $partFile) {
            $stream = $this->filesystem->readStream($partFile);
            if (stream_copy_to_stream($stream$tmp) === false) {
                throw ImportExportException::processingError('Failed to merge files');
            }
        }

        // copy final file into filesystem         $this->filesystem->writeStream($target$tmp);

        if (\is_resource($tmp)) {
            fclose($tmp);
        }

        if ($tmpFile) {
            
Home | Imprint | This part of the site doesn't use cookies.