mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-27 11:12:15 -05:00
handle database error on secret key insert
This commit is contained in:
parent
6e4d0dede1
commit
0013199b2d
@ -630,7 +630,10 @@ public class ProviderHelper {
|
||||
values.put(KeyRingData.KEY_RING_DATA, keyRing.getEncoded());
|
||||
// insert new version of this keyRing
|
||||
Uri uri = KeyRingData.buildSecretKeyRingUri(Long.toString(masterKeyId));
|
||||
mContentResolver.insert(uri, values);
|
||||
if (mContentResolver.insert(uri, values) == null) {
|
||||
log(LogLevel.ERROR, LogType.MSG_IS_DB_EXCEPTION);
|
||||
return new SaveKeyringResult(SaveKeyringResult.RESULT_ERROR, mLog);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
Log.e(Constants.TAG, "Failed to encode key!", e);
|
||||
log(LogLevel.ERROR, LogType.MSG_IS_IO_EXCPTION);
|
||||
|
@ -171,6 +171,7 @@ public class OperationResultParcel implements Parcelable {
|
||||
// import secret
|
||||
MSG_IS(R.string.msg_is),
|
||||
MSG_IS_BAD_TYPE_PUBLIC (R.string.msg_is_bad_type_public),
|
||||
MSG_IS_DB_EXCEPTION (R.string.msg_is_db_exception),
|
||||
MSG_IS_IMPORTING_SUBKEYS (R.string.msg_is_importing_subkeys),
|
||||
MSG_IS_IO_EXCPTION (R.string.msg_is_io_excption),
|
||||
MSG_IS_SUBKEY_NONEXISTENT (R.string.msg_is_subkey_nonexistent),
|
||||
|
@ -555,6 +555,7 @@
|
||||
|
||||
<!-- Import Secret log entries -->
|
||||
<string name="msg_is">Importing secret key %s</string>
|
||||
<string name="msg_is_db_exception">Database error!</string>
|
||||
<string name="msg_is_importing_subkeys">Processing secret subkeys</string>
|
||||
<string name="msg_is_io_excption">Error encoding keyring</string>
|
||||
<string name="msg_is_subkey_nonexistent">Subkey %s unavailable in public key</string>
|
||||
|
Loading…
Reference in New Issue
Block a user