Ruby & JSON: error - 776: unexpected token at

Trabla: Ruby & JSON: error - 776: unexpected token at


Solving:

This error appears when json is not valid and parsing failed.

Example:

# this is invalid json - missing  "}"
json = '{"id":1234,"age":32'  

obj = JSON.parse( json )

Ruby JSON error - 776 unexpected token at



No comments:

Post a Comment