com.xliic.cicd.common.TaskException Maven / Gradle / Ivy
/*
Copyright (c) 42Crunch Ltd. All rights reserved.
Licensed under the GNU Affero General Public License version 3. See LICENSE.txt in the project root for license information.
*/
package com.xliic.cicd.common;
public class TaskException extends Exception {
/**
*
*/
private static final long serialVersionUID = 6795526460296139587L;
private Throwable error;
private boolean isNetworkError = false;
public TaskException(String message) {
super(message);
}
public TaskException(String message, Throwable error) {
super(message);
this.error = error;
}
public TaskException(String message, Throwable error, boolean isNetworkError) {
super(message);
this.error = error;
this.isNetworkError = isNetworkError;
}
public void setError(Throwable error) {
this.error = error;
}
public boolean isNetworkError() {
return this.isNetworkError;
}
public void setIsNetworkError(boolean isNetworkError) {
this.isNetworkError = isNetworkError;
}
@Override
public String getMessage() {
String message = super.getMessage();
if (this.error != null) {
return message + ": " + this.error.getMessage();
}
return message;
}
public Throwable getError() {
return error;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy