Newer
Older
Sonia Zorba
committed
/*
* This file is part of vospace-file-service
* Copyright (C) 2021 Istituto Nazionale di Astrofisica
* SPDX-License-Identifier: GPL-3.0-or-later
*/
package it.inaf.ia2.transfer.exception;
Sonia Zorba
committed
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
Sonia Zorba
committed
public class JobException extends RuntimeException {
public static enum Type {
TRANSIENT("transient"),
FATAL("fatal");
private final String value;
private Type(String v) {
value = v;
}
public String value() {
return value;
}
}
private final Type type;
private String errorDetail;
public JobException(Type type, String message) {
super(message);
Sonia Zorba
committed
this.type = type;
}
public Type getType() {
return type;
}
public String getErrorDetail() {
return errorDetail;
}
public final JobException setErrorDetail(String errorDetail) {
Sonia Zorba
committed
this.errorDetail = errorDetail;
return this;
}
}