diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-07-31 19:05:09 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-07-31 19:05:09 +0200 |
commit | 80f9c769c05485c517036e602a8c83901c63e733 (patch) | |
tree | 6eb3405f8a71019a4ce0edac9cc70c6931a76239 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport | |
parent | b052d5e89cb323f528d568373605adaab03cb4a4 (diff) | |
download | open-keychain-80f9c769c05485c517036e602a8c83901c63e733.tar.gz open-keychain-80f9c769c05485c517036e602a8c83901c63e733.tar.bz2 open-keychain-80f9c769c05485c517036e602a8c83901c63e733.zip |
Keyserver exception translateable
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java | 2 | ||||
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/Keyserver.java | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java index 8ff133164..43bed8397 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java @@ -265,7 +265,7 @@ public class HkpKeyserver extends Keyserver { throw new QueryFailedException("Keyserver '" + mHost + "' not found. Error 404"); } else { // NOTE: some keyserver do not provide a more detailed error response - throw new QueryFailedException("Either no keys or too many have been found. Please improve your query!"); + throw new QueryTooShortOrTooManyResponsesException(); } } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/Keyserver.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/Keyserver.java index 842e7d922..b726529f8 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/Keyserver.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/Keyserver.java @@ -44,6 +44,13 @@ public abstract class Keyserver { private static final long serialVersionUID = 2703768928624654514L; } + /** + * query too short _or_ too many responses + */ + public static class QueryTooShortOrTooManyResponsesException extends QueryNeedsRepairException { + private static final long serialVersionUID = 2703768928624654514L; + } + public static class AddKeyException extends Exception { private static final long serialVersionUID = -507574859137295530L; } |