mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-19 06:43:45 +02:00
Fix seed imports
This commit is contained in:
@@ -76,7 +76,16 @@ class EggImporterService
|
||||
public function handle(UploadedFile $file, int $nest): Egg
|
||||
{
|
||||
if ($file->getError() !== UPLOAD_ERR_OK || ! $file->isFile()) {
|
||||
throw new InvalidFileUploadException(trans('exceptions.nest.importer.file_error'));
|
||||
throw new InvalidFileUploadException(
|
||||
sprintf(
|
||||
'The selected file ["%s"] was not in a valid format to import. (is_file: %s is_valid: %s err_code: %s err: %s)',
|
||||
$file->getFilename(),
|
||||
$file->isFile() ? 'true' : 'false',
|
||||
$file->isValid() ? 'true' : 'false',
|
||||
$file->getError(),
|
||||
$file->getErrorMessage()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$parsed = json_decode($file->openFile()->fread($file->getSize()));
|
||||
|
||||
@@ -57,7 +57,16 @@ class EggUpdateImporterService
|
||||
public function handle(int $egg, UploadedFile $file)
|
||||
{
|
||||
if ($file->getError() !== UPLOAD_ERR_OK || ! $file->isFile()) {
|
||||
throw new InvalidFileUploadException(trans('exceptions.nest.importer.file_error'));
|
||||
throw new InvalidFileUploadException(
|
||||
sprintf(
|
||||
'The selected file ["%s"] was not in a valid format to import. (is_file: %s is_valid: %s err_code: %s err: %s)',
|
||||
$file->getFilename(),
|
||||
$file->isFile() ? 'true' : 'false',
|
||||
$file->isValid() ? 'true' : 'false',
|
||||
$file->getError(),
|
||||
$file->getErrorMessage()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$parsed = json_decode($file->openFile()->fread($file->getSize()));
|
||||
|
||||
Reference in New Issue
Block a user