summaryrefslogtreecommitdiff
path: root/pokemontools/exceptions.py
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2013-09-01 15:40:22 -0500
committerBryan Bishop <kanzure@gmail.com>2013-09-01 15:40:22 -0500
commitccc1d82d957bd98ffd60c15410eec67888f5e212 (patch)
treeb2a18451555c2aab2768425a0b5093b816a5ee39 /pokemontools/exceptions.py
parent74a9f14502a51f25f16be62135d28dc7adba6fbb (diff)
use a custom AddressException instead of asserts
There's no reason to have asserts thrown around in the source code like that. This replaces some of them with an AddressException and a new file called "exceptions.py" to store the exception definitions.
Diffstat (limited to 'pokemontools/exceptions.py')
-rw-r--r--pokemontools/exceptions.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/pokemontools/exceptions.py b/pokemontools/exceptions.py
new file mode 100644
index 0000000..674f829
--- /dev/null
+++ b/pokemontools/exceptions.py
@@ -0,0 +1,8 @@
+"""
+Custom exceptions used throughout the project.
+"""
+
+class AddressException(Exception):
+ """
+ There was a problem with an address. Maybe it was out of range or invalid.
+ """