From 004201abda111d786d6f899c98b9603f18c5f5d1 Mon Sep 17 00:00:00 2001 From: Mark Date: Mon, 4 Dec 2023 11:19:36 -0700 Subject: [PATCH] add module name and missing predicate key to module_does_not_contain_claimed_export error (#2195) --- src/machine/machine_errors.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/machine/machine_errors.rs b/src/machine/machine_errors.rs index f509b46c..02133f32 100644 --- a/src/machine/machine_errors.rs +++ b/src/machine/machine_errors.rs @@ -492,13 +492,22 @@ impl MachineState { self.permission_error(Permission::Modify, atom!("static_module"), module) } SessionError::ExistenceError(err) => self.existence_error(err), - SessionError::ModuleDoesNotContainExport(..) => { - let error_atom = atom!("module_does_not_contain_claimed_export"); + SessionError::ModuleDoesNotContainExport(module_name, key) => { + let functor_stub = functor_stub(key.0, key.1); + + let stub = functor!( + atom!("module_does_not_contain_claimed_export"), + [ + atom(module_name), + str(self.heap.len() + 4, 0) + ], + [functor_stub] + ); self.permission_error( Permission::Access, atom!("private_procedure"), - functor!(error_atom), + stub, ) } SessionError::ModuleCannotImportSelf(module_name) => { -- 2.54.0