From 19ce9fea0325c882b3bfd15ac071d9d262c54585 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Mon, 22 Jun 2020 17:41:51 -0700 Subject: [PATCH] Raise custom NotEnoughSpace exception instead of IOError. --- rarpar.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rarpar.py b/rarpar.py index 3e05cd4..1c3d365 100644 --- a/rarpar.py +++ b/rarpar.py @@ -12,6 +12,12 @@ from voussoirkit import winglob RESERVE_SPACE_ON_DRIVE = 30 * bytestring.GIBIBYTE +class RarParException(Exception): + pass + +class NotEnoughSpace(RarParException): + pass + def RARCOMMAND( basename, input_pattern, @@ -105,7 +111,7 @@ def assert_enough_space(pathsize, workdir, moveto, rec, rev, par): print(message) if reserve > free_space: - raise IOError('Please leave more space') + raise NotEnoughSpace('Please leave more space') def move(pattern, directory): files = winglob.glob(pattern)