2021-04-15 02:37:54 +02:00
|
|
|
package eu.openaire.urls_worker.models;
|
|
|
|
|
2021-04-24 20:08:02 +02:00
|
|
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
2021-04-15 02:37:54 +02:00
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
2021-04-24 20:08:02 +02:00
|
|
|
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
2021-04-15 02:37:54 +02:00
|
|
|
|
2021-04-24 20:08:02 +02:00
|
|
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
|
|
|
@JsonPropertyOrder({
|
|
|
|
"type",
|
|
|
|
"message"
|
|
|
|
})
|
2021-04-15 02:37:54 +02:00
|
|
|
public class Error {
|
|
|
|
|
2021-08-05 14:09:28 +02:00
|
|
|
public enum ErrorType {
|
|
|
|
couldRetry, noRetry
|
|
|
|
}
|
|
|
|
|
2021-04-15 02:37:54 +02:00
|
|
|
@JsonProperty("type")
|
2021-08-05 14:09:28 +02:00
|
|
|
private ErrorType type;
|
2021-04-15 02:37:54 +02:00
|
|
|
|
|
|
|
@JsonProperty("message")
|
2021-04-24 20:08:02 +02:00
|
|
|
private String message;
|
2021-04-15 02:37:54 +02:00
|
|
|
|
2021-08-05 14:09:28 +02:00
|
|
|
public Error(ErrorType type, String message) {
|
|
|
|
this.type = type;
|
|
|
|
this.message = message;
|
|
|
|
}
|
|
|
|
|
|
|
|
public ErrorType getType() {
|
2021-04-15 02:37:54 +02:00
|
|
|
return type;
|
|
|
|
}
|
|
|
|
|
2021-08-05 14:09:28 +02:00
|
|
|
public void setType(ErrorType type) {
|
|
|
|
this.type = type;
|
2021-04-15 02:37:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public String getMessage() {
|
|
|
|
return message;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setMessage(String message) {
|
|
|
|
this.message = message;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "Error{" +
|
2021-08-05 14:09:28 +02:00
|
|
|
"type=" + type +
|
2021-04-15 02:37:54 +02:00
|
|
|
", message='" + message + '\'' +
|
|
|
|
'}';
|
|
|
|
}
|
|
|
|
}
|