Skip to content

Commit

Permalink
bore: More useful error message
Browse files Browse the repository at this point in the history
  • Loading branch information
LightArrowsEXE committed Jul 2, 2024
1 parent 7a8d304 commit 88f721c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions vsadjust/borders.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from itertools import chain
from typing import Sequence

from vstools import CustomEnum, CustomValueError, FunctionUtil, KwargsT, PlanesT, core, vs
from vstools import CustomEnum, CustomValueError, FunctionUtil, KwargsT, NotFoundEnumValue, PlanesT, core, vs

__all__ = [
'bore'
Expand Down Expand Up @@ -36,11 +36,15 @@ def __call__(
elif self == self.BALANCE:
plugin = core.bore.Balance
else:
raise AttributeError
raise NotFoundEnumValue
except AttributeError:
raise CustomValueError(
'Could not find this bore function! Make sure you\'re using an up-to-date version of Bore.',
func.func, dict(function=self.value)
func.func, dict(function=self)
)
except NotFoundEnumValue:
raise NotFoundEnumValue(
'Invalid bore enum!', func.func, dict(member=self, valid_function=bore.__members__.keys())
)

proc_clip: vs.VideoNode = func.work_clip
Expand Down

0 comments on commit 88f721c

Please sign in to comment.