Raise custom NotEnoughSpace exception instead of IOError.

This commit is contained in:
voussoir 2020-06-22 17:41:51 -07:00
parent 581893fa7c
commit 19ce9fea03

View file

@ -12,6 +12,12 @@ from voussoirkit import winglob
RESERVE_SPACE_ON_DRIVE = 30 * bytestring.GIBIBYTE RESERVE_SPACE_ON_DRIVE = 30 * bytestring.GIBIBYTE
class RarParException(Exception):
pass
class NotEnoughSpace(RarParException):
pass
def RARCOMMAND( def RARCOMMAND(
basename, basename,
input_pattern, input_pattern,
@ -105,7 +111,7 @@ def assert_enough_space(pathsize, workdir, moveto, rec, rev, par):
print(message) print(message)
if reserve > free_space: if reserve > free_space:
raise IOError('Please leave more space') raise NotEnoughSpace('Please leave more space')
def move(pattern, directory): def move(pattern, directory):
files = winglob.glob(pattern) files = winglob.glob(pattern)