mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Handle when v1 is deprecated, print a message instead of an error
This commit is contained in:
parent
8e25bbf61a
commit
0d0c5458dd
2 changed files with 11 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue