Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Parsing bad JSON should result in error Quark can handle #246

Open
itamarst opened this issue Aug 12, 2016 · 0 comments
Open

Parsing bad JSON should result in error Quark can handle #246

itamarst opened this issue Aug 12, 2016 · 0 comments

Comments

@itamarst
Copy link
Contributor

Right now in Python, and maybe other languages, if you try to parse non-JSON string as JSON you get an exception. This means you can't handle this in Quark.

    json = _JSONObject.parse((contents).contents);
  File "/usr/lib/python2.7/site-packages/quark_runtime.py", line 234, in parse
    return cls._wrap(cls._backend.loads(value, object_pairs_hook=cls._dict))
  File "/usr/lib/python2.7/json/__init__.py", line 352, in loads
    return cls(encoding=encoding, **kw).decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant