summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2016-12-13 12:58:34 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2016-12-13 12:58:34 +0000
commitc66390e2e79492d50d384c4cf737c7d2cfd0a453 (patch)
tree797568a53d3ed2279a8a28944fed59c1001e5e57
parent6fd17bfdddff8e7cc1f033fe25afc70acdb4e22f (diff)
downloadgitano-c66390e2e79492d50d384c4cf737c7d2cfd0a453.tar.gz
Explain error codes when a command fails
-rw-r--r--lang/en.lua2
-rw-r--r--lib/gitano/util.lua2
2 files changed, 2 insertions, 2 deletions
diff --git a/lang/en.lua b/lang/en.lua
index 7f438ff..7f766c5 100644
--- a/lang/en.lua
+++ b/lang/en.lua
@@ -230,7 +230,7 @@ example administration repository rules and an admin user and group.
DEBUG_WELCOME_TO = "Welcome to ${site}",
DEBUG_RUNNING = "Running:",
DEBUG_ON_BEHALF_OF = "On behalf of ${user} using key ${key}",
- ERROR_RUNNING_COMMAND = "Error running ${cmd}: ${reason}",
+ ERROR_RUNNING_COMMAND = "Error running ${cmd}: ${reason} ${code}",
UNABLE_TO_CONTINUE = "Unable to continue",
MSG_COMPLETED_SUCCESSFULLY = "${cmd} completed successfully",
WARN_UNTERMINATED_STRING = "Un-terminated quoted string",
diff --git a/lib/gitano/util.lua b/lib/gitano/util.lua
index 2581eb0..8bcbfd1 100644
--- a/lib/gitano/util.lua
+++ b/lib/gitano/util.lua
@@ -30,7 +30,7 @@ local function run_command(cmd, cmdline, parsed_cmdline, user,
if how ~= "exit" or why ~= 0 then
log.critical(i18n.expand("ERROR_RUNNING_COMMAND",
- {cmd=parsed_cmdline[1], reason=how}))
+ {cmd=parsed_cmdline[1], reason=how, code=why}))
log.critical(i18n.expand("UNABLE_TO_CONTINUE"))
return why
else