MCPcopy
hub / github.com/pyload/pyload / JSONDecodeError

Class JSONDecodeError

module/lib/simplejson/decoder.py:32–55  ·  view source on GitHub ↗

Subclass of ValueError with the following additional properties: msg: The unformatted error message doc: The JSON document being parsed pos: The start index of doc where parsing failed end: The end index of doc where parsing failed (may be None) lineno: The line corresponding to

Source from the content-addressed store, hash-verified

30
31
32class JSONDecodeError(ValueError):
33 """Subclass of ValueError with the following additional properties:
34
35 msg: The unformatted error message
36 doc: The JSON document being parsed
37 pos: The start index of doc where parsing failed
38 end: The end index of doc where parsing failed (may be None)
39 lineno: The line corresponding to pos
40 colno: The column corresponding to pos
41 endlineno: The line corresponding to end (may be None)
42 endcolno: The column corresponding to end (may be None)
43
44 """
45 def __init__(self, msg, doc, pos, end=None):
46 ValueError.__init__(self, errmsg(msg, doc, pos, end=end))
47 self.msg = msg
48 self.doc = doc
49 self.pos = pos
50 self.end = end
51 self.lineno, self.colno = linecol(doc, pos)
52 if end is not None:
53 self.endlineno, self.endcolno = linecol(doc, end)
54 else:
55 self.endlineno, self.endcolno = None, None
56
57
58def linecol(doc, pos):

Callers 5

py_scanstringFunction · 0.85
JSONObjectFunction · 0.85
JSONArrayFunction · 0.85
decodeMethod · 0.85
raw_decodeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected