python: move the exception classes into error.py