com.afrozaar.wordpress.wpapi.v2.exception.UsernameAlreadyExistsException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wp-api-v2-client-java Show documentation
Show all versions of wp-api-v2-client-java Show documentation
A Java client implementation to the WordPress WP-API v2 plugin.
package com.afrozaar.wordpress.wpapi.v2.exception;
import org.springframework.web.client.HttpStatusCodeException;
public class UsernameAlreadyExistsException extends WpApiParsedException {
public UsernameAlreadyExistsException(HttpStatusCodeException cause) {
super(ParsedRestException.of(cause));
}
public UsernameAlreadyExistsException(ParsedRestException parsed) {
super(parsed);
}
public RuntimeException orRuntime(String runtimeMessage) throws UsernameAlreadyExistsException {
if (ExceptionCodes.EXISTING_USER_LOGIN.equals(this.getCode())) {
throw this;
} else {
throw new RuntimeException(runtimeMessage + ": " + super.toString(), super.getCause());
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy