@@ -65,6 +65,7 @@ import Unison.Codebase.Editor.Output.PushPull qualified as PushPull
6565import Unison.Codebase.Editor.SlurpResult qualified as SlurpResult
6666import Unison.Codebase.Editor.StructuredArgument (StructuredArgument )
6767import Unison.Codebase.Editor.StructuredArgument qualified as SA
68+ import Unison.Codebase.Init.OpenCodebaseError qualified as CodebaseInit
6869import Unison.Codebase.IntegrityCheck (IntegrityResult (.. ), prettyPrintIntegrityErrors )
6970import Unison.Codebase.Patch qualified as Patch
7071import Unison.Codebase.Path qualified as Path
@@ -974,6 +975,7 @@ notifyUser dir = \case
974975 -- defs in the codebase. In some cases it's fine for bindings to
975976 -- shadow codebase names, but you don't want it to capture them in
976977 -- the decompiled output.
978+
977979 let prettyBindings =
978980 P. bracket . P. lines $
979981 P. wrap " The watch expression(s) reference these definitions:"
@@ -2264,6 +2266,31 @@ notifyUser dir = \case
22642266 case syncErr of
22652267 Sync. TransportError te -> pure (prettyTransportError te)
22662268 Sync. SyncError pullErr -> pure (prettyPullV2Error pullErr)
2269+ SyncFromCodebaseMissingProjectBranch projectBranch ->
2270+ pure . P. wrap $
2271+ " I couldn't sync from the codebase because the project branch"
2272+ <> prettyProjectAndBranchName projectBranch
2273+ <> " doesn't exist."
2274+ OpenCodebaseError codebasePath err -> case err of
2275+ CodebaseInit. OpenCodebaseDoesntExist ->
2276+ pure . P. wrap $ " I couldn't find a valid codebase at " <> prettyFilePath codebasePath
2277+ CodebaseInit. OpenCodebaseUnknownSchemaVersion schemaVersion ->
2278+ pure . P. wrap . P. lines $
2279+ [ " I couldn't open the codebase at " <> prettyFilePath codebasePath <> " ." ,
2280+ " The schema version appears to be newer than the current UCM version can support." ,
2281+ " You may need to upgrade UCM. The codebase is at schema version: " <> P. shown schemaVersion
2282+ ]
2283+ CodebaseInit. OpenCodebaseFileLockFailed -> do
2284+ pure . P. wrap . P. lines $
2285+ [ " I couldn't open the codebase at " <> prettyFilePath codebasePath,
2286+ " It appears another process is using that codebase, please close other UCM instances and try again."
2287+ ]
2288+ CodebaseInit. OpenCodebaseRequiresMigration currentSV requiredSV ->
2289+ pure . P. wrap . P. lines $
2290+ [ " I couldn't open the codebase at " <> prettyFilePath codebasePath,
2291+ " The codebase is at schema version " <> P. shown currentSV <> " but UCM requires schema version " <> P. shown requiredSV <> " ." ,
2292+ " Please open the other codebase with UCM directly to upgrade it to the latest version, then try again."
2293+ ]
22672294
22682295prettyShareError :: ShareError -> Pretty
22692296prettyShareError =
0 commit comments