Change return code for KeyboardInterrupt

This commit is contained in:
Linus Groh
2018-01-04 13:13:15 +01:00
parent 0af4a13c2b
commit e175608135
2 changed files with 5 additions and 2 deletions

View File

@@ -283,7 +283,7 @@ docker run --rm -it -v $(pwd):/music ritiek/spotify-downloader -l ncs-releases.t
- `0` - Success
- `1` - Unknown error
- `2` - Command line error (e.g. invalid args)
- `-1` - KeyboardInterrupt
- `3` - `KeyboardInterrupt`
- `10` - Invalid playlist URL
- `11` - Playlist not found

View File

@@ -475,8 +475,11 @@ if __name__ == '__main__':
grab_album(album=args.album)
elif args.username:
feed_playlist(username=args.username)
# Actually we don't necessarily need this, but yeah...
# Explicit is better than implicit!
sys.exit(0)
except KeyboardInterrupt as e:
log.exception(e)
sys.exit(-1)
sys.exit(3)