Refactor error class

I refactored the error handling I did in a previous PR

* correct namespacing for error class
* remove forgotton old error class file