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 16
16
class Json implements SerializerInterface
17
17
{
18
18
/**
19
- * { @inheritDoc}
19
+ * @inheritDoc
20
20
* @since 100.2.0
21
21
*/
22
22
public function serialize ($ data )
23
23
{
24
24
$ result = json_encode ($ data );
25
25
if (false === $ result ) {
26
- throw new \InvalidArgumentException (' Unable to serialize value. ' );
26
+ throw new \InvalidArgumentException (" Unable to serialize value. Error: " . json_last_error_msg () );
27
27
}
28
28
return $ result ;
29
29
}
30
30
31
31
/**
32
- * { @inheritDoc}
32
+ * @inheritDoc
33
33
* @since 100.2.0
34
34
*/
35
35
public function unserialize ($ string )
36
36
{
37
37
$ result = json_decode ($ string , true );
38
38
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 () );
40
40
}
41
41
return $ result ;
42
42
}
You can’t perform that action at this time.
0 commit comments