Handle when v1 is deprecated, print a message instead of an error

This commit is contained in:
Shane Kilkelly 2019-01-07 11:54:44 +00:00
parent 8e25bbf61a
commit 0d0c5458dd
2 changed files with 11 additions and 0 deletions

View file

@ -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(

View file

@ -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