put exceptions inside class to prevent linker errors