improve error handling when loading edge weights