diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/handler/WLRepositoryResolver.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/handler/WLRepositoryResolver.java index 022101fc5b..e0ee16b366 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/handler/WLRepositoryResolver.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/handler/WLRepositoryResolver.java @@ -109,7 +109,10 @@ public class WLRepositoryResolver } catch (ForbiddenException e) { throw new ServiceNotAuthorizedException(); } catch (GitUserException e) { - throw new ServiceMayNotContinueException(e.getMessage(), e); + throw new ServiceMayNotContinueException( + e.getMessage() + "\n" + + String.join("\n", e.getDescriptionLines()), + e); } catch (IOException e) { Log.warn( "IOException when trying to open repo: " + projName, diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/MissingRepositoryException.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/MissingRepositoryException.java index 9578c18f27..320e3d192e 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/MissingRepositoryException.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/MissingRepositoryException.java @@ -10,42 +10,43 @@ import java.util.List; public class MissingRepositoryException extends SnapshotAPIException { public static final List GENERIC_REASON = Arrays.asList( - "This Overleaf project currently has no git access.", + "This Overleaf project currently has no git access, either because", + "the project does not exist, or because git access is not enabled", + "for the project.", "", - "If this problem persists, please contact us." + "If this is unexpected, please contact us at support@overleaf.com, or", + "see https://www.overleaf.com/help/342 for more information." ); static List buildExportedToV2Message(String remoteUrl) { if (remoteUrl == null) { return Arrays.asList( - "This Overleaf project has been moved to Overleaf v2 and cannot be used with git at this time.", - "", - "If this error persists, please contact us at support@overleaf.com, or", - "see https://www.overleaf.com/help/342 for more information." + "This Overleaf project has been moved to Overleaf v2 and cannot be used with git at this time.", + "", + "If this error persists, please contact us at support@overleaf.com, or", + "see https://www.overleaf.com/help/342 for more information." ); } else { return Arrays.asList( - "This Overleaf project has been moved to Overleaf v2 and has a new identifier.", - "Please update your remote to:", - "", - " " + remoteUrl, - "", - "Assuming you are using the default \"origin\" remote, the following commands", - "will change the remote for you:", - "", - " git remote set-url origin " + remoteUrl, - "", - "If this does not work, please contact us at support@overleaf.com, or", - "see https://www.overleaf.com/help/342 for more information." + "This Overleaf project has been moved to Overleaf v2 and has a new identifier.", + "Please update your remote to:", + "", + " " + remoteUrl, + "", + "Assuming you are using the default \"origin\" remote, the following commands", + "will change the remote for you:", + "", + " git remote set-url origin " + remoteUrl, + "", + "If this does not work, please contact us at support@overleaf.com, or", + "see https://www.overleaf.com/help/342 for more information." ); } } private List descriptionLines; - public MissingRepositoryException() { - descriptionLines = new ArrayList(); - } + public MissingRepositoryException() { this.descriptionLines = GENERIC_REASON; } public MissingRepositoryException(List descriptionLines) { this.descriptionLines = descriptionLines;