FMCorz / mdk

Moodle Development Kit. A collection of tools meant to make developers' lives easier.
GNU General Public License v3.0
85 stars 47 forks source link

mdk run error is not displayed in non-debug mode #143

Open danpoltawski opened 8 years ago

danpoltawski commented 8 years ago

When debugging is off, mdk run doesn't show the error caused by my mistype. The 'script not found error' should be displayed even when debugging level is disabled.

$ mdk run versions.php
Running 'versions.php' on 'im'
Error while running the script on im
Done.
$ mdk config set debug debug
$ mdk run versions.php
/usr/local/bin/git remote -v
/usr/local/bin/git config --get remote.origin.url
Running 'versions.php' on 'im'
Error while running the script on im
Script not found
Done.
FMCorz commented 8 years ago

It was intentional not to show the exception details, but if it's always that short then it should be fine.

mudrd8mz commented 8 years ago

+1

I ran to similar issue when I had a stalled mdkscriptrun.sh left from a previous process that was ctrl+c'ed. I had no idea what was wrong unless @danpoltawski suggested to raise debugging level as described here. So I was able to deduct what was wrong then.

I believe that in case of error, being more verbose is always better than not being verbose - especially in tools used solely by developers, like this.

danpoltawski commented 8 years ago

I believe that in case of error, being more verbose is always better than not being verbose

Just like those java stacktraces in tomcat and so on? 😹

(Joking) I absolutely agree - I don't like debug mode on all the time because I don't care what command is running, but frequently I get a situation like a git operation failing and mdk fails but doens't say what goes wrong. Would be great if it could output the error.