File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
lib/internal/Magento/Framework/Serialize/Serializer Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1616class Json implements SerializerInterface
1717{
1818 /**
19- * { @inheritDoc}
19+ * @inheritDoc
2020 * @since 100.2.0
2121 */
2222 public function serialize ($ data )
2323 {
2424 $ result = json_encode ($ data );
2525 if (false === $ result ) {
26- throw new \InvalidArgumentException (' Unable to serialize value. ' );
26+ throw new \InvalidArgumentException (" Unable to serialize value. Error: " . json_last_error_msg () );
2727 }
2828 return $ result ;
2929 }
3030
3131 /**
32- * { @inheritDoc}
32+ * @inheritDoc
3333 * @since 100.2.0
3434 */
3535 public function unserialize ($ string )
3636 {
3737 $ result = json_decode ($ string , true );
3838 if (json_last_error () !== JSON_ERROR_NONE ) {
39- throw new \InvalidArgumentException (' Unable to unserialize value. ' );
39+ throw new \InvalidArgumentException (" Unable to unserialize value. Error: " . json_last_error_msg () );
4040 }
4141 return $ result ;
4242 }
You can’t perform that action at this time.
0 commit comments