summaryrefslogtreecommitdiffstats
path: root/pendulum/tz/exceptions.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-01-30 08:13:47 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-01-30 08:13:47 +0000
commit1199780155f666b6806d563a29d093a251664009 (patch)
tree68716d9c1ee3205f474a04d74d5653eddf94a9f2 /pendulum/tz/exceptions.py
parentInitial commit. (diff)
downloadpendulum-1199780155f666b6806d563a29d093a251664009.tar.xz
pendulum-1199780155f666b6806d563a29d093a251664009.zip
Adding upstream version 2.1.2.upstream/2.1.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'pendulum/tz/exceptions.py')
-rw-r--r--pendulum/tz/exceptions.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/pendulum/tz/exceptions.py b/pendulum/tz/exceptions.py
new file mode 100644
index 0000000..d1572f9
--- /dev/null
+++ b/pendulum/tz/exceptions.py
@@ -0,0 +1,23 @@
+class TimezoneError(ValueError):
+
+ pass
+
+
+class NonExistingTime(TimezoneError):
+
+ message = "The datetime {} does not exist."
+
+ def __init__(self, dt):
+ message = self.message.format(dt)
+
+ super(NonExistingTime, self).__init__(message)
+
+
+class AmbiguousTime(TimezoneError):
+
+ message = "The datetime {} is ambiguous."
+
+ def __init__(self, dt):
+ message = self.message.format(dt)
+
+ super(AmbiguousTime, self).__init__(message)