Create our own exceptions, move into errors.py
Improve some logic