mirror of https://github.com/shred/acme4j
Do not return shortened error type any more
parent
896269ec33
commit
4b96878688
|
@ -15,8 +15,6 @@ package org.shredzone.acme4j.exception;
|
|||
|
||||
import java.util.Objects;
|
||||
|
||||
import org.shredzone.acme4j.util.AcmeUtils;
|
||||
|
||||
/**
|
||||
* An exception that is thrown when the ACME server returned an error. It contains
|
||||
* further details of the cause.
|
||||
|
@ -47,15 +45,4 @@ public class AcmeServerException extends AcmeException {
|
|||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -433,7 +433,6 @@ public class DefaultConnectionTest {
|
|||
} catch (AcmeServerException ex) {
|
||||
assertThat(ex.getType(), is("urn:ietf:params:acme:error:unauthorized"));
|
||||
assertThat(ex.getMessage(), is("Invalid response: 404"));
|
||||
assertThat(ex.getAcmeErrorType(), is("unauthorized"));
|
||||
} catch (AcmeException ex) {
|
||||
fail("Expected an AcmeServerException");
|
||||
}
|
||||
|
@ -469,7 +468,6 @@ public class DefaultConnectionTest {
|
|||
} catch (AcmeServerException ex) {
|
||||
assertThat(ex.getType(), is("urn:zombie:error:apocalypse"));
|
||||
assertThat(ex.getMessage(), is("Zombie apocalypse in progress"));
|
||||
assertThat(ex.getAcmeErrorType(), is(nullValue()));
|
||||
} catch (AcmeException ex) {
|
||||
fail("Expected an AcmeServerException");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue