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

@@ -3492,6 +3492,12 @@ impl Machine {
Some(Ok(c)) => {
string.push(c);
}
Some(Err(e)) => {
let stub = functor_stub(atom!("$get_n_chars"), 3);
let err = self.machine_st.session_error(SessionError::from(e));
return Err(self.machine_st.error_form(err, stub));
}
_ => {
break;
}