Skip to content

Commit

Permalink
Change error type
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanLua authored Jul 24, 2024
1 parent 991ca0a commit f6f382a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/instawebhooks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import logging
import re
from argparse import ArgumentParser, ArgumentTypeError
from argparse import ArgumentParser
from datetime import datetime, timedelta
from itertools import dropwhile, takewhile
from time import sleep
Expand All @@ -24,7 +24,7 @@ def regex(pattern: str | re.Pattern):

def closure_check_regex(arg_value):
if not re.match(pattern, arg_value):
raise ArgumentTypeError("invalid value")
raise ValueError(f"invalid value: '{arg_value}'")
return arg_value

return closure_check_regex
Expand Down

0 comments on commit f6f382a

Please sign in to comment.