comparison src/memory/memory.py @ 620:64db6758d223

core: more explicit UnknownEntityError
author Goffi <goffi@goffi.org>
date Thu, 20 Jun 2013 12:11:54 +0200
parents d722778b152c
children 5646ecd3e35e
comparison
equal deleted inserted replaced
619:1de01a2154e2 620:64db6758d223
787 if not profile: 787 if not profile:
788 raise exceptions.UnknownProfileError(_('Trying to get entity data for a non-existant profile')) 788 raise exceptions.UnknownProfileError(_('Trying to get entity data for a non-existant profile'))
789 if not profile in self.entitiesCache: 789 if not profile in self.entitiesCache:
790 raise exceptions.ProfileNotInCacheError 790 raise exceptions.ProfileNotInCacheError
791 if not entity_jid.userhost() in self.entitiesCache[profile]: 791 if not entity_jid.userhost() in self.entitiesCache[profile]:
792 raise exceptions.UnknownEntityError 792 raise exceptions.UnknownEntityError(entity_jid.userhost())
793 entity_data = self.entitiesCache[profile][entity_jid.userhost()] 793 entity_data = self.entitiesCache[profile][entity_jid.userhost()]
794 if not keys_list: 794 if not keys_list:
795 return entity_data 795 return entity_data
796 ret = {} 796 ret = {}
797 for key in keys_list: 797 for key in keys_list: