From a8939461bcb7459f4f0f72d4e67e253e128dc144 Mon Sep 17 00:00:00 2001 From: ignace nyamagana butera Date: Thu, 10 Oct 2024 07:54:03 +0200 Subject: [PATCH] Improve JSONConverter exception message --- src/JsonConverter.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/JsonConverter.php b/src/JsonConverter.php index 0a10fadb..8f5b00d3 100644 --- a/src/JsonConverter.php +++ b/src/JsonConverter.php @@ -316,9 +316,7 @@ public function save(iterable $records, mixed $destination, $context = null): in } restore_error_handler(); - if (false === $writtenBytes) { - throw new RuntimeException('Unable to write to the stream.'); - } + false !== $writtenBytes || throw new RuntimeException('Unable to write '.(isset($line) ? '`'.$line.'`' : '').' to the destination path.'); return $bytes; }