File tree Expand file tree Collapse file tree 1 file changed +3
-17
lines changed
lib/internal/Magento/Framework/Serialize/Serializer Expand file tree Collapse file tree 1 file changed +3
-17
lines changed Original file line number Diff line number Diff line change @@ -23,11 +23,7 @@ public function serialize($data)
23
23
{
24
24
$ result = json_encode ($ data );
25
25
if (false === $ result ) {
26
- $ errorMessage = "Unable to serialize value. " ;
27
- if (!$ this ->isOnProduction ()){
28
- $ errorMessage .= "Error: " . json_last_error_msg ();
29
- }
30
- throw new \InvalidArgumentException ($ errorMessage );
26
+ throw new \InvalidArgumentException ("Unable to serialize value. Error: " . json_last_error_msg ());
31
27
}
32
28
return $ result ;
33
29
}
@@ -40,18 +36,8 @@ public function unserialize($string)
40
36
{
41
37
$ result = json_decode ($ string , true );
42
38
if (json_last_error () !== JSON_ERROR_NONE ) {
43
- $ errorMessage = "Unable to unserialize value. " ;
44
- if (!$ this ->isOnProduction ()){
45
- $ errorMessage .= "Error: " . json_last_error_msg ();
46
- }
47
- throw new \InvalidArgumentException ($ errorMessage );
39
+ throw new \InvalidArgumentException ("Unable to unserialize value. Error: " . json_last_error_msg ());
48
40
}
49
41
return $ result ;
50
- }
51
-
52
- private function isOnProduction (){
53
- $ appState = \Magento \Framework \App \ObjectManager::getInstance ()
54
- ->get ('Magento\Framework\App\State ' );
55
- return $ appState === \Magento \Framework \App \State::MODE_PRODUCTION ;
56
- }
42
+ }
57
43
}
You can’t perform that action at this time.
0 commit comments