From 56fc47125560ac68338a959c25763b1153717afa Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Tue, 9 Aug 2016 08:15:12 -0400 Subject: [PATCH] better error when unable to load executable. --- bin/main.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/main.cpp b/bin/main.cpp index e671a2a..078cd98 100644 --- a/bin/main.cpp +++ b/bin/main.cpp @@ -682,8 +682,14 @@ int main(int argc, char **argv) CreateStack(); - uint16_t err = Loader::Native::LoadFile(command); - if (err) exit(EX_CONFIG); + { + auto rv = Loader::Native::LoadFile(command); + if (!rv) { + fprintf(stderr, "### Unable to load %s\n", command.c_str()); + fprintf(stderr, "# %s (OS error %d)\n", ErrorName(rv.error()), rv.error()); + exit(EX_CONFIG); + } + } GlobalInit();