mirror of
https://git.webmeisterei.com/webmeisterei/todoist-taskwarrior.git
synced 2023-12-21 10:23:00 +01:00
Change base Exception to UnsupportedRecurrence
This commit is contained in:
9
todoist_taskwarrior/errors.py
Normal file
9
todoist_taskwarrior/errors.py
Normal file
@ -0,0 +1,9 @@
|
||||
""" Custom Errors """
|
||||
|
||||
|
||||
class UnsupportedRecurrence(Exception):
|
||||
|
||||
def __init__(self, date_string):
|
||||
super().__init__('Unsupported recurrence: %s' % date_string)
|
||||
self.date_string = date_string
|
||||
|
@ -1,6 +1,7 @@
|
||||
import click
|
||||
import re
|
||||
from datetime import datetime
|
||||
from .errors import UnsupportedRecurrence
|
||||
|
||||
""" Validation """
|
||||
|
||||
@ -94,7 +95,7 @@ def parse_recur(date_string):
|
||||
_recur_special(date_string)
|
||||
)
|
||||
if not result:
|
||||
raise Exception("Recurrence not supported: %s" % date_string)
|
||||
raise UnsupportedRecurrence(date_string)
|
||||
return result
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user