rake icon indicating copy to clipboard operation
rake copied to clipboard

Aborting `rake` execution needlessly dumps a backtrace

Open booch opened this issue 7 years ago • 3 comments

When aborting rake with Ctrl+C, it outputs rake aborted! then dumps a long backtrace. This seems unnecessary, as aborting isn't really an unexpected outcome of pressing Ctrl+C (or sending an INT signal).

I'd like to propose catching the Interrupt exception and exiting cleanly (with an exit code of 1). We can still print the backtrace if the --trace option is used.

I can submit a pull request, if this seems reasonable.

booch avatar Aug 30 '18 20:08 booch

Exit code, should be more specific than 1: http://tldp.org/LDP/abs/html/exitcodes.html

sleep infinity
# Ctl-C
echo $?
# 130

SwagDevOps avatar Sep 02 '18 16:09 SwagDevOps

Is this something we still want to look at? I can also submit a PR for this if needed.

mateusdeap avatar Oct 19 '22 12:10 mateusdeap

Yes! I'm still interested.

SwagDevOps avatar Nov 21 '22 22:11 SwagDevOps