MCPcopy Index your code
hub / github.com/httpie/cli / NestedJSONSyntaxError

Class NestedJSONSyntaxError

httpie/cli/nested_json/errors.py:6–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4
5
6class NestedJSONSyntaxError(ValueError):
7 def __init__(
8 self,
9 source: str,
10 token: Optional[Token],
11 message: str,
12 message_kind: str = 'Syntax',
13 ) -> None:
14 self.source = source
15 self.token = token
16 self.message = message
17 self.message_kind = message_kind
18
19 def __str__(self):
20 lines = [f'HTTPie {self.message_kind} Error: {self.message}']
21 if self.token is not None:
22 lines.append(self.source)
23 lines.append(
24 ' ' * self.token.start
25 + HIGHLIGHTER * (self.token.end - self.token.start)
26 )
27 return '\n'.join(lines)

Callers 3

expectFunction · 0.85
type_checkFunction · 0.85
interpretFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected