From 2701907614ea1e0d3b9c64e089b481f3e3d7ac33 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Thu, 30 Apr 2020 19:07:26 +0200 Subject: [PATCH] Improve the 'invalid architecture' error message Not that I'm expecting to ever see this error message. --- src/plugin/host-bridge.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/plugin/host-bridge.cpp b/src/plugin/host-bridge.cpp index e8a07531..ebb36ab7 100644 --- a/src/plugin/host-bridge.cpp +++ b/src/plugin/host-bridge.cpp @@ -627,12 +627,15 @@ PluginArchitecture find_plugin_architecture(fs::path plugin_path) { case 0x0000: // IMAGE_FILE_MACHINE_UNKNOWN return PluginArchitecture::vst_64; break; - default: - throw std::runtime_error( - "'" + plugin_path.string() + - "' does not have a supported architecture: " + - std::to_string(machine_type)); - break; + default: { + std::ostringstream error_msg; + error_msg << "'" << plugin_path + << "' is neither a x86 nor a x86_64 PE32 file. Actual " + "architecture: 0x" + << std::hex << machine_type; + + throw std::runtime_error(error_msg.str()); + } break; } }