throw errors from char_reader.rs and get_n_chars when reading bad UTF8 data (#2244)

This commit is contained in:
Mark
2023-12-26 12:30:46 -07:00
parent 2fa46e6b6c
commit 42d6749501
3 changed files with 40 additions and 29 deletions

View File

@@ -417,6 +417,9 @@ impl ParserError {
ParserError::IO(e) if e.kind() == ErrorKind::UnexpectedEof => {
atom!("unexpected_end_of_file")
}
ParserError::IO(e) if e.kind() == ErrorKind::InvalidData => {
atom!("invalid_data")
}
ParserError::IO(_) => atom!("input_output_error"),
ParserError::LexicalError(_) => atom!("lexical_error"),
ParserError::MissingQuote(..) => atom!("missing_quote"),