MCPcopy Create free account
hub / github.com/simplejson/simplejson / JSONDecodeError

Class JSONDecodeError

simplejson/errors.py:26–53  ·  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

24
25
26class JSONDecodeError(ValueError):
27 """Subclass of ValueError with the following additional properties:
28
29 msg: The unformatted error message
30 doc: The JSON document being parsed
31 pos: The start index of doc where parsing failed
32 end: The end index of doc where parsing failed (may be None)
33 lineno: The line corresponding to pos
34 colno: The column corresponding to pos
35 endlineno: The line corresponding to end (may be None)
36 endcolno: The column corresponding to end (may be None)
37
38 """
39 # Note that this exception is used from _speedups
40 def __init__(self, msg, doc, pos, end=None):
41 ValueError.__init__(self, errmsg(msg, doc, pos, end=end))
42 self.msg = msg
43 self.doc = doc
44 self.pos = pos
45 self.end = end
46 self.lineno, self.colno = linecol(doc, pos)
47 if end is not None:
48 self.endlineno, self.endcolno = linecol(doc, end)
49 else:
50 self.endlineno, self.endcolno = None, None
51
52 def __reduce__(self):
53 return self.__class__, (self.msg, self.doc, self.pos, self.end)

Callers 8

scan_four_digit_hexFunction · 0.85
py_scanstringFunction · 0.85
JSONObjectFunction · 0.85
JSONArrayFunction · 0.85
decodeMethod · 0.85
raw_decodeMethod · 0.85
_scan_onceFunction · 0.85
scan_onceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…