https://github.com/timbrist/math_json_parser/blob/4f4095528f0f469fb55736baef506cc569085e69/math_json_parser/parser_polars.py#L100 It makes debugging easier if the error contains information about the expected type/value and received type/value, which leads to the error.