File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 1353
1353
name : KorifiError
1354
1354
http_code : 500
1355
1355
message : " %s"
1356
+
1357
+ 420001 :
1358
+ name : DeserializationError
1359
+ http_code : 500
1360
+ message : " %s"
Original file line number Diff line number Diff line change @@ -7,7 +7,12 @@ def serializes_via_json(accessor_method_name)
7
7
string = send ( "#{ accessor_method_name } _without_serialization" )
8
8
return if string . blank?
9
9
10
- MultiJson . load string
10
+ begin
11
+ MultiJson . load string
12
+ rescue MultiJson ::ParseError
13
+ error = "Failed to deserialize #{ guid } for object type #{ self . class } . Trying to deserialize #{ string } . You may have to delete and recreate the object"
14
+ raise CloudController ::Errors ::ApiError . new_from_details ( 'DeserializationError' , error )
15
+ end
11
16
end
12
17
alias_method "#{ accessor_method_name } _without_serialization" , accessor_method_name
13
18
alias_method accessor_method_name , "#{ accessor_method_name } _with_serialization"
You can’t perform that action at this time.
0 commit comments