diff options
author | Jose Diaz-Gonzalez <email@josediazgonzalez.com> | 2016-07-27 03:46:17 -0400 |
---|---|---|
committer | Jose Diaz-Gonzalez <email@josediazgonzalez.com> | 2016-07-27 03:46:17 -0400 |
commit | e2f7c46974a14bfe6fd2813b4643c314c517a52b (patch) | |
tree | 99a862ebb955a23b413edc69a99923428fd032c4 | |
parent | 194d6f2e1593a2fbbc9b2abf0dcda91242e90ad5 (diff) | |
download | croniter-e2f7c46974a14bfe6fd2813b4643c314c517a52b.tar.gz |
Fix error message when not able to find a previous date
Refs #34
-rw-r--r-- | src/croniter/croniter.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/croniter/croniter.py b/src/croniter/croniter.py index 327326f..5cc2f41 100644 --- a/src/croniter/croniter.py +++ b/src/croniter/croniter.py @@ -363,7 +363,9 @@ class croniter(object): continue return self._datetime_to_timestamp(dst.replace(microsecond=0)) - raise Exception("failed to find prev date") + if is_prev: + raise Exception("failed to find prev date") + raise Exception("failed to find next date") def _get_next_nearest(self, x, to_check): small = [item for item in to_check if item < x] |