abhisharma404/vault

Handle CTRL+C properly

mzfr opened this issue · 3 comments

mzfr commented

Currently pressing ctrl+c while scans are going on we get a big traceback.
It would be nice if we can handle that traceback and print something nice like Canceled by the user or something similar.

Read this to understand how to do it properly.

Tried to implement here #98. But the solution is not so obvious. Can't find the way to gracefully stop running scanning thread. So need to press Ctrl-C two times in a row.

Tried to solve #94 by putting the entire body of code within a try...except block.On keyboard interrupt, The except block displays 'Process Stopped by user'. However,it also gives an Exception and a traceback.To stop that, I redirected stderr to a file 'err.txt'. This makes it such that the user gets a clean response on pressing Ctrl + C.My implementation is Here #99.

I would like to work on this issue