2017-12-15 13:01:42 +01:00
|
|
|
package org.gcube.dataanalysis.dataminer.poolmanager.util.exception;
|
|
|
|
|
|
|
|
import org.tmatesoft.svn.core.SVNErrorMessage;
|
|
|
|
|
2023-01-18 17:56:48 +01:00
|
|
|
public class SVNCommitException extends DMPMException {
|
2017-12-15 13:01:42 +01:00
|
|
|
|
2023-01-18 17:56:48 +01:00
|
|
|
/**
|
2017-12-15 13:01:42 +01:00
|
|
|
*
|
2023-01-18 17:56:48 +01:00
|
|
|
*/
|
2017-12-15 13:01:42 +01:00
|
|
|
private static final long serialVersionUID = -5225403308313619585L;
|
|
|
|
|
|
|
|
private SVNErrorMessage svnErrorMessage;
|
|
|
|
|
|
|
|
private String fileName;
|
|
|
|
|
2023-01-18 17:56:48 +01:00
|
|
|
public SVNCommitException(SVNErrorMessage errorMessage, String fileName) {
|
2017-12-15 13:01:42 +01:00
|
|
|
super ("Unable to commit");
|
|
|
|
this.svnErrorMessage = errorMessage;
|
2017-12-15 16:46:26 +01:00
|
|
|
this.fileName = fileName;
|
2023-01-18 17:56:48 +01:00
|
|
|
}
|
2017-12-15 13:01:42 +01:00
|
|
|
|
2023-01-18 17:56:48 +01:00
|
|
|
public SVNCommitException(String message,SVNErrorMessage errorMessage,String fileName) {
|
2017-12-15 13:01:42 +01:00
|
|
|
super (message);
|
|
|
|
this.svnErrorMessage = errorMessage;
|
2017-12-15 16:46:26 +01:00
|
|
|
this.fileName = fileName;
|
2023-01-18 17:56:48 +01:00
|
|
|
}
|
2017-12-15 13:01:42 +01:00
|
|
|
|
2023-01-18 17:56:48 +01:00
|
|
|
public SVNErrorMessage getSvnErrorMessage() {
|
2017-12-15 13:01:42 +01:00
|
|
|
return svnErrorMessage;
|
2017-12-15 16:46:26 +01:00
|
|
|
|
2023-01-18 17:56:48 +01:00
|
|
|
}
|
2017-12-15 13:01:42 +01:00
|
|
|
|
2017-12-15 16:46:26 +01:00
|
|
|
|
|
|
|
|
2023-01-18 17:56:48 +01:00
|
|
|
@Override
|
|
|
|
public String getErrorMessage() {
|
2017-12-15 16:46:26 +01:00
|
|
|
|
|
|
|
return "Commit operation failed for "+this.fileName
|
|
|
|
+ "the message of the SVN Server is the following:\n"+this.svnErrorMessage.getMessage();
|
|
|
|
|
2023-01-18 17:56:48 +01:00
|
|
|
}
|
2017-12-15 13:01:42 +01:00
|
|
|
|
|
|
|
|
2023-01-18 17:56:48 +01:00
|
|
|
}
|