Revert "Replace PgpGeneralException with NotFoundException where appropriate"
This reverts commit 49b4ff6312.
This commit is contained in:
@@ -229,6 +229,9 @@ public class EditKeyFragment extends LoaderFragment implements
|
||||
} catch (NotFoundException e) {
|
||||
finishWithError(LogType.MSG_EK_ERROR_NOT_FOUND);
|
||||
return;
|
||||
} catch (PgpGeneralException e) {
|
||||
finishWithError(LogType.MSG_EK_ERROR_NOT_FOUND);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@@ -139,7 +139,7 @@ public class EncryptAsymmetricFragment extends Fragment implements EncryptActivi
|
||||
setSignatureKeyId(keyring.getMasterKeyId());
|
||||
mSign.setSelectedKeyId(mEncryptInterface.getSignatureKey());
|
||||
}
|
||||
} catch (ProviderHelper.NotFoundException e) {
|
||||
} catch (PgpGeneralException e) {
|
||||
Log.e(Constants.TAG, "key not found!", e);
|
||||
}
|
||||
}
|
||||
@@ -151,7 +151,7 @@ public class EncryptAsymmetricFragment extends Fragment implements EncryptActivi
|
||||
CachedPublicKeyRing ring = mProviderHelper.getCachedPublicKeyRing(
|
||||
KeyRings.buildUnifiedKeyRingsFindBySubkeyUri(preselectedId));
|
||||
mEncryptKeyView.addObject(mEncryptKeyView.new EncryptionKey(ring));
|
||||
} catch (ProviderHelper.NotFoundException e) {
|
||||
} catch (PgpGeneralException e) {
|
||||
Log.e(Constants.TAG, "key not found!", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ public class MultiCertifyKeyFragment extends LoaderFragment
|
||||
if (key.canCertify()) {
|
||||
mCertifyKeySpinner.setSelectedKeyId(certifyKeyId);
|
||||
}
|
||||
} catch (ProviderHelper.NotFoundException e) {
|
||||
} catch (PgpGeneralException e) {
|
||||
Log.e(Constants.TAG, "certify certify check failed", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ public class PassphraseDialogActivity extends FragmentActivity {
|
||||
// the catch clause doesn't return.
|
||||
try {
|
||||
userId = mSecretRing.getPrimaryUserIdWithFallback();
|
||||
} catch (ProviderHelper.NotFoundException e) {
|
||||
} catch (PgpGeneralException e) {
|
||||
userId = null;
|
||||
}
|
||||
|
||||
@@ -312,7 +312,7 @@ public class PassphraseDialogActivity extends FragmentActivity {
|
||||
PassphraseCacheService.addCachedPassphrase(getActivity(),
|
||||
mSecretRing.getMasterKeyId(), mSubKeyId, passphrase,
|
||||
mSecretRing.getPrimaryUserIdWithFallback());
|
||||
} catch (ProviderHelper.NotFoundException e) {
|
||||
} catch (PgpGeneralException e) {
|
||||
Log.e(Constants.TAG, "adding of a passphrase failed", e);
|
||||
}
|
||||
|
||||
|
||||
@@ -185,7 +185,7 @@ public class ViewCertActivity extends ActionBarActivity
|
||||
KeyRings.buildUnifiedKeyRingsFindBySubkeyUri(mCertifierKeyId)).getMasterKeyId();
|
||||
viewIntent.setData(KeyRings.buildGenericKeyRingUri(signerMasterKeyId));
|
||||
startActivity(viewIntent);
|
||||
} catch (ProviderHelper.NotFoundException e) {
|
||||
} catch (PgpGeneralException e) {
|
||||
// TODO notify user of this, maybe offer download?
|
||||
Log.e(Constants.TAG, "key not found!", e);
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ public class ViewKeyMainFragment extends LoaderFragment implements
|
||||
}
|
||||
// used instead of startActivity set actionbar based on callingPackage
|
||||
startActivityForResult(intent, 0);
|
||||
} catch (NotFoundException e) {
|
||||
} catch (PgpGeneralException e) {
|
||||
Log.e(Constants.TAG, "key not found!", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor
|
||||
// the catch clause doesn't return.
|
||||
try {
|
||||
userId = mSecretRing.getPrimaryUserIdWithFallback();
|
||||
} catch (ProviderHelper.NotFoundException e) {
|
||||
} catch (PgpGeneralException e) {
|
||||
userId = null;
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor
|
||||
PassphraseCacheService.addCachedPassphrase(getActivity(),
|
||||
mSecretRing.getMasterKeyId(), mSubKeyId, passphrase,
|
||||
mSecretRing.getPrimaryUserIdWithFallback());
|
||||
} catch (ProviderHelper.NotFoundException e) {
|
||||
} catch (PgpGeneralException e) {
|
||||
Log.e(Constants.TAG, "adding of a passphrase failed", e);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@ import com.tokenautocomplete.TokenCompleteTextView;
|
||||
|
||||
import org.sufficientlysecure.keychain.Constants;
|
||||
import org.sufficientlysecure.keychain.R;
|
||||
import org.sufficientlysecure.keychain.provider.ProviderHelper;
|
||||
import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils;
|
||||
import org.sufficientlysecure.keychain.util.ContactHelper;
|
||||
import org.sufficientlysecure.keychain.pgp.KeyRing;
|
||||
@@ -199,7 +198,7 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView {
|
||||
|
||||
}
|
||||
|
||||
public EncryptionKey(CachedPublicKeyRing ring) throws ProviderHelper.NotFoundException {
|
||||
public EncryptionKey(CachedPublicKeyRing ring) throws PgpGeneralException {
|
||||
this(ring.getPrimaryUserId(), ring.extractOrGetMasterKeyId(),
|
||||
KeyFormattingUtils.convertFingerprintToHex(ring.getFingerprint()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user