# HG changeset patch # User Goffi # Date 1453737825 -3600 # Node ID fb94f92dc7400abd543c2e49b6b482632d61ed56 # Parent 5b8a859d5bb4c5cd605b08c705fdd213999be4e1 core (params): return given profile for ProfileUnknownError diff -r 5b8a859d5bb4 -r fb94f92dc740 src/memory/params.py --- a/src/memory/params.py Sun Jan 24 18:28:08 2016 +0100 +++ b/src/memory/params.py Mon Jan 25 17:03:45 2016 +0100 @@ -190,7 +190,7 @@ """ if not self.storage.hasProfile(profile): log.info(_('Trying to delete an unknown profile')) - return defer.fail(Failure(exceptions.ProfileUnknownError)) + return defer.fail(Failure(exceptions.ProfileUnknownError(profile))) if self.host.isConnected(profile): if force: self.host.disconnect(profile) @@ -218,7 +218,7 @@ default = self.host.memory.memory_data['Profile_default'] = self.storage.getProfilesList()[0] except IndexError: log.info(_('No profile exist yet')) - raise exceptions.ProfileUnknownError + raise exceptions.ProfileUnknownError(profile_key) return default # FIXME: temporary, must use real default value, and fallback to first one if it doesn't exists elif profile_key == C.PROF_KEY_NONE: raise exceptions.ProfileNotSetError @@ -226,7 +226,7 @@ return profile_key # this value must be managed by the caller if not self.storage.hasProfile(profile_key): log.error(_(u'Trying to access an unknown profile (%s)') % profile_key) - raise exceptions.ProfileUnknownError + raise exceptions.ProfileUnknownError(profile_key) return profile_key def __get_unique_node(self, parent, tag, name): @@ -435,7 +435,7 @@ if ((param_cat, param_name) == C.PROFILE_PASS_PATH) or not value: return defer.succeed(value) # profile password and empty passwords are returned "as is" if not profile: - raise exceptions.ProfileUnknownError('The profile is needed to decrypt a password') + raise exceptions.ProfileNotSetError('The profile is needed to decrypt a password') d = self.host.memory.decryptValue(value, profile) def gotPlainPassword(password): @@ -491,7 +491,7 @@ profile = self.getProfileName(profile_key) if not profile: log.error(_('Requesting a param for an non-existant profile')) - raise exceptions.ProfileUnknownError + raise exceptions.ProfileUnknownError(profile_key) if profile not in self.params: log.error(_('Requesting synchronous param for not connected profile')) @@ -814,7 +814,7 @@ profile = self.getProfileName(profile_key) if not profile: log.error(_(u'Trying to set parameter for an unknown profile')) - raise exceptions.ProfileUnknownError + raise exceptions.ProfileUnknownError(profile_key) node = self._getParamNode(name, category, '@ALL@') if not node: