Updated Error object to include a constructor and to_hash methods