mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-31 12:51:35 +02:00
Handle when v1 is deprecated, print a message instead of an error
This commit is contained in:
@@ -18,6 +18,13 @@ public class MissingRepositoryException extends SnapshotAPIException {
|
||||
"see https://www.overleaf.com/help/342 for more information."
|
||||
);
|
||||
|
||||
public static final List<String> OVERLEAF_V1_DEPRECATED_REASON = Arrays.asList(
|
||||
"Overleaf v1 is deprecated, and you need to migrate this project to v2.",
|
||||
"",
|
||||
"If this is unexpected, please contact us at support@overleaf.com, or",
|
||||
"see https://www.overleaf.com/help/342 for more information."
|
||||
);
|
||||
|
||||
static List<String> buildExportedToV2Message(String remoteUrl) {
|
||||
if (remoteUrl == null) {
|
||||
return Arrays.asList(
|
||||
|
||||
@@ -90,6 +90,10 @@ public abstract class Request<T extends Result> {
|
||||
throw new MissingRepositoryException(
|
||||
MissingRepositoryException.buildExportedToV2Message(newRemote)
|
||||
);
|
||||
} else if ("Overleaf v1 is Deprecated".equals(message)) {
|
||||
throw new MissingRepositoryException(
|
||||
MissingRepositoryException.OVERLEAF_V1_DEPRECATED_REASON
|
||||
);
|
||||
}
|
||||
} catch (IllegalStateException
|
||||
| ClassCastException
|
||||
|
||||
Reference in New Issue
Block a user