Do not return shortened error type any more

pull/55/head
Richard Körber 2017-05-01 12:13:48 +02:00
parent 896269ec33
commit 4b96878688
2 changed files with 0 additions and 15 deletions

View File

@ -15,8 +15,6 @@ package org.shredzone.acme4j.exception;
import java.util.Objects; import java.util.Objects;
import org.shredzone.acme4j.util.AcmeUtils;
/** /**
* An exception that is thrown when the ACME server returned an error. It contains * An exception that is thrown when the ACME server returned an error. It contains
* further details of the cause. * further details of the cause.
@ -47,15 +45,4 @@ public class AcmeServerException extends AcmeException {
return type; return type;
} }
/**
* Returns the ACME error type. This is the last part of the type URN, e.g.
* {@code "malformed"} on {@code "urn:ietf:params:acme:error:malformed"}.
*
* @return ACME error type, or {@code null} if this is not an
* {@code "urn:ietf:params:acme:error"}
*/
public String getAcmeErrorType() {
return AcmeUtils.stripErrorPrefix(type);
}
} }

View File

@ -433,7 +433,6 @@ public class DefaultConnectionTest {
} catch (AcmeServerException ex) { } catch (AcmeServerException ex) {
assertThat(ex.getType(), is("urn:ietf:params:acme:error:unauthorized")); assertThat(ex.getType(), is("urn:ietf:params:acme:error:unauthorized"));
assertThat(ex.getMessage(), is("Invalid response: 404")); assertThat(ex.getMessage(), is("Invalid response: 404"));
assertThat(ex.getAcmeErrorType(), is("unauthorized"));
} catch (AcmeException ex) { } catch (AcmeException ex) {
fail("Expected an AcmeServerException"); fail("Expected an AcmeServerException");
} }
@ -469,7 +468,6 @@ public class DefaultConnectionTest {
} catch (AcmeServerException ex) { } catch (AcmeServerException ex) {
assertThat(ex.getType(), is("urn:zombie:error:apocalypse")); assertThat(ex.getType(), is("urn:zombie:error:apocalypse"));
assertThat(ex.getMessage(), is("Zombie apocalypse in progress")); assertThat(ex.getMessage(), is("Zombie apocalypse in progress"));
assertThat(ex.getAcmeErrorType(), is(nullValue()));
} catch (AcmeException ex) { } catch (AcmeException ex) {
fail("Expected an AcmeServerException"); fail("Expected an AcmeServerException");
} }