io.castle.client.model.CastleServerErrorException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of castle-java Show documentation
Show all versions of castle-java Show documentation
Castle adds real-time monitoring of your authentication stack, instantly notifying you and your users
on potential account hijacks.
package io.castle.client.model;
import io.castle.client.Castle;
import okhttp3.Response;
import java.io.IOException;
public class CastleServerErrorException extends CastleRuntimeException {
private final int responseCode;
private final String responseMessage;
private String response;
public CastleServerErrorException(Response response) {
super(response.toString());
this.responseCode = response.code();
this.responseMessage = response.message();
try {
this.response = response.body().string();
} catch (NullPointerException | IOException | IllegalStateException e) {
Castle.logger.error("CastleServerErrorException. No response body.", e);
}
}
public int getResponseCode() {
return responseCode;
}
public String getResponseMessage() {
return responseMessage;
}
public String getResponse() {
return response;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy