throw permission_error when non-input stream is read

Signed-off-by: Thierry Marianne <thierry@marianne.io>
This commit is contained in:
Thierry Marianne
2025-09-15 08:28:23 +02:00
parent 28ec457159
commit e9834ffa3e

View File

@@ -766,7 +766,16 @@ impl MachineState {
indices,
MachineState::read_term_from_user_input_eof_handler,
),
_ => Err(functor_stub(atom!("read_term_from_user_input"), 3)),
_ => {
let stub = functor_stub(atom!("read_term_from_user_input"), 3);
let err = self.permission_error(
Permission::InputStream,
atom!("stream"),
atom_as_cell!(atom!("user_input")),
);
Err(self.error_form(err, stub))
}
}
}