factor out ErrorObject class hierarchy