2023-03-31 14:53:52 +02:00
|
|
|
package eu.dnetlib.openaire.exporter.exceptions;
|
|
|
|
|
2023-04-03 12:22:22 +02:00
|
|
|
public class DsmApiException extends Exception {
|
2023-03-31 14:53:52 +02:00
|
|
|
|
|
|
|
private static final long serialVersionUID = -8173126561260106405L;
|
|
|
|
|
|
|
|
private int code;
|
|
|
|
|
2023-04-03 12:22:22 +02:00
|
|
|
public DsmApiException(final int code, final String msg) {
|
2023-03-31 14:53:52 +02:00
|
|
|
super(msg);
|
|
|
|
this.code = code;
|
|
|
|
}
|
|
|
|
|
2023-04-03 12:22:22 +02:00
|
|
|
public DsmApiException(final int code, final Throwable e) {
|
2023-03-31 14:53:52 +02:00
|
|
|
super(e);
|
|
|
|
this.code = code;
|
|
|
|
}
|
|
|
|
|
2023-04-03 12:22:22 +02:00
|
|
|
public DsmApiException(final int code, final String msg, final Throwable e) {
|
2023-03-31 14:53:52 +02:00
|
|
|
super(msg, e);
|
|
|
|
this.code = code;
|
|
|
|
}
|
|
|
|
|
2023-04-03 12:22:22 +02:00
|
|
|
public DsmApiException(final String msg) {
|
2023-03-31 14:53:52 +02:00
|
|
|
this(500, msg);
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getCode() {
|
|
|
|
return code;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setCode(final int code) {
|
|
|
|
this.code = code;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|