From 0e6fdc32a1e66405faa08eb79fbc3e05e6fa0cf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sat, 8 Sep 2018 10:23:49 -0700 Subject: Clarify beam_load error message on file/module mismatch This is particularly important in case insensitive filesystems, where attempting to invoke a module with the wrong case leads to confusing error messages: 1> erlpress_core:foo(). beam/beam_load.c(1428): Error loading module 'erlpress_core': module name in object code is erlPress_core Loading of erlPress_core.beam failed: :badfile This commit replaces object code by BEAM file and improves the readability of the message. --- erts/emulator/beam/beam_load.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts/emulator/beam/beam_load.c') diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index 50cbb37f3e..d8cf3fb8e2 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -1425,7 +1425,7 @@ load_atom_table(LoaderState* stp, ErtsAtomEncoding enc) ap = atom_tab(atom_val(stp->atom[1])); sys_memcpy(sbuf, ap->name, ap->len); sbuf[ap->len] = '\0'; - LoadError1(stp, "module name in object code is %s", sbuf); + LoadError1(stp, "BEAM file exists but it defines a module named %s", sbuf); } return 1; -- cgit v1.2.3