|
@@ -4,27 +4,35 @@ import com.google.gson.JsonElement;
|
|
|
import uk.ac.ic.wlgitbridge.git.exception.SnapshotAPIException;
|
|
import uk.ac.ic.wlgitbridge.git.exception.SnapshotAPIException;
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
public class MissingRepositoryException extends SnapshotAPIException {
|
|
public class MissingRepositoryException extends SnapshotAPIException {
|
|
|
|
|
|
|
|
- public static final String GENERIC_REASON =
|
|
|
|
|
- "This Overleaf project currently has no git access.\n" +
|
|
|
|
|
- "\n" +
|
|
|
|
|
- "If this problem persists, please contact us.";
|
|
|
|
|
|
|
+ public static final List<String> GENERIC_REASON = Arrays.asList(
|
|
|
|
|
+ "This Overleaf project currently has no git access.",
|
|
|
|
|
+ "",
|
|
|
|
|
+ "If this problem persists, please contact us."
|
|
|
|
|
+ );
|
|
|
|
|
|
|
|
- public static final String EXPORTED_TO_V2 =
|
|
|
|
|
- "This Overleaf project has been moved to Overleaf v2, and git access is temporarily unsupported.\n" +
|
|
|
|
|
- "\n" +
|
|
|
|
|
- "See https://www.overleaf.com/help/342 for more information.";
|
|
|
|
|
|
|
+ public static final List<String> EXPORTED_TO_V2 = Arrays.asList(
|
|
|
|
|
+ "This Overleaf project has been moved to Overleaf v2, and git access is temporarily unsupported.",
|
|
|
|
|
+ "",
|
|
|
|
|
+ "See https://www.overleaf.com/help/342 for more information."
|
|
|
|
|
+ );
|
|
|
|
|
|
|
|
- private String message = "";
|
|
|
|
|
|
|
+ private List<String> descriptionLines;
|
|
|
|
|
|
|
|
public MissingRepositoryException() {
|
|
public MissingRepositoryException() {
|
|
|
|
|
+ descriptionLines = new ArrayList<String>();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public MissingRepositoryException(String message) {
|
|
public MissingRepositoryException(String message) {
|
|
|
- this.message = message;
|
|
|
|
|
|
|
+ this.descriptionLines = Arrays.asList(message);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public MissingRepositoryException(List<String> descriptionLines) {
|
|
|
|
|
+ this.descriptionLines = descriptionLines;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -32,12 +40,12 @@ public class MissingRepositoryException extends SnapshotAPIException {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public String getMessage() {
|
|
public String getMessage() {
|
|
|
- return message;
|
|
|
|
|
|
|
+ return String.join("\n", this.descriptionLines);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public List<String> getDescriptionLines() {
|
|
public List<String> getDescriptionLines() {
|
|
|
- return Arrays.asList(getMessage());
|
|
|
|
|
|
|
+ return this.descriptionLines;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|