diff options
author | Bryan Bishop <kanzure@gmail.com> | 2013-09-01 15:40:22 -0500 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2013-09-01 15:40:22 -0500 |
commit | ccc1d82d957bd98ffd60c15410eec67888f5e212 (patch) | |
tree | b2a18451555c2aab2768425a0b5093b816a5ee39 /pokemontools/exceptions.py | |
parent | 74a9f14502a51f25f16be62135d28dc7adba6fbb (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.py | 8 |
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. + """ |