From 05d861e3bbe6d5b7897d0bee866919303220c6a2 Mon Sep 17 00:00:00 2001 From: Diego Pino Navarro Date: Mon, 13 Jul 2020 21:26:19 -0400 Subject: [PATCH] Also throw error if JSON not present or empty --- src/Commands/JsonApiDrushCommands.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Commands/JsonApiDrushCommands.php b/src/Commands/JsonApiDrushCommands.php index 0227173..38e1499 100644 --- a/src/Commands/JsonApiDrushCommands.php +++ b/src/Commands/JsonApiDrushCommands.php @@ -433,7 +433,13 @@ public function ingest( } } - + else { + throw new \Exception( + dt( + 'JSON payload seems to be missing or invalid JSON. Suspending the ingest' + ) + ); + } if ($field_name) { foreach ($files as $file) {