diff --git a/ports/src/vancouver/boot_module_provider.h b/ports/src/vancouver/boot_module_provider.h index 07ea3ddb8..477ab42d1 100644 --- a/ports/src/vancouver/boot_module_provider.h +++ b/ports/src/vancouver/boot_module_provider.h @@ -37,6 +37,7 @@ class Boot_module_provider * Exception class */ class Destination_buffer_too_small { }; + class Module_loading_failed { }; /** * Constructor @@ -107,10 +108,13 @@ class Boot_module_provider PWRN("XML node %d in multiboot node has unexpected type", module_index); - return 0; + throw Module_loading_failed(); } catch (Xml_node::Nonexistent_sub_node) { } catch (Xml_node::Nonexistent_attribute) { } + catch (...) { + throw Module_loading_failed(); + } /* * We should get here only if there are XML parsing errors diff --git a/ports/src/vancouver/main.cc b/ports/src/vancouver/main.cc index 8ec8a0f2e..9caf757f1 100644 --- a/ports/src/vancouver/main.cc +++ b/ports/src/vancouver/main.cc @@ -847,7 +847,11 @@ class Machine : public StaticReceiver try { data_len = _boot_modules.data(index, data_dst, dst_len); } catch (Boot_module_provider::Destination_buffer_too_small) { - Logging::printf("could not load module, destination buffer too small\n"); + Logging::panic("could not load module, destination buffer too small\n"); + return false; + } catch (Boot_module_provider::Module_loading_failed) { + Logging::panic("could not load module %d," + " unknown reason\n", index); return false; }