jsonyx.TruncatedSyntaxError¶
- exception jsonyx.TruncatedSyntaxError(msg, filename, doc, start=0, end=0)¶
Bases:
SyntaxErrorSyntax error trucated to fit within the terminal width.
Added in version 2.0.
- Parameters:
- Example:
>>> import jsonyx as json >>> raise json.TruncatedSyntaxError( ... "Invalid number", "<string>", "9" * 5000, 0, 5000 ... ) Traceback (most recent call last): File "<string>", line 1, column 1-5001 99999999999999999999999999999999999...9999999999999999999999999999999999 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ jsonyx.TruncatedSyntaxError: Invalid number
Tip
You can overwrite the width by setting the
COLUMNSenvironment variable.See also
jsonyx.format_syntax_error()for formatting the exception.