Modified error.hpp for proper exception