From 52f0631ec482db850577182dc67a39692785e167 Mon Sep 17 00:00:00 2001 From: Mahanthesh Shadakshari Date: Thu, 31 Mar 2016 10:51:33 +0530 Subject: [PATCH] Adding error message in throwing RuntimeException --- src/JMS/Serializer/JsonSerializationVisitor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/JMS/Serializer/JsonSerializationVisitor.php b/src/JMS/Serializer/JsonSerializationVisitor.php index 5d917cc6b..ef0d650d0 100644 --- a/src/JMS/Serializer/JsonSerializationVisitor.php +++ b/src/JMS/Serializer/JsonSerializationVisitor.php @@ -36,7 +36,7 @@ public function getResult() throw new \RuntimeException('Your data could not be encoded because it contains invalid UTF8 characters.'); default: - throw new \RuntimeException(sprintf('An error occurred while encoding your data (error code %d).', json_last_error())); + throw new \RuntimeException(sprintf('An error occurred while encoding your data (error code %d)(error message %s).', json_last_error(), json_last_error_msg())); } }