@@ -65,6 +65,7 @@ import Unison.Codebase.Editor.Output.PushPull qualified as PushPull
65
65
import Unison.Codebase.Editor.SlurpResult qualified as SlurpResult
66
66
import Unison.Codebase.Editor.StructuredArgument (StructuredArgument )
67
67
import Unison.Codebase.Editor.StructuredArgument qualified as SA
68
+ import Unison.Codebase.Init.OpenCodebaseError qualified as CodebaseInit
68
69
import Unison.Codebase.IntegrityCheck (IntegrityResult (.. ), prettyPrintIntegrityErrors )
69
70
import Unison.Codebase.Patch qualified as Patch
70
71
import Unison.Codebase.Path qualified as Path
@@ -974,6 +975,7 @@ notifyUser dir = \case
974
975
-- defs in the codebase. In some cases it's fine for bindings to
975
976
-- shadow codebase names, but you don't want it to capture them in
976
977
-- the decompiled output.
978
+
977
979
let prettyBindings =
978
980
P. bracket . P. lines $
979
981
P. wrap " The watch expression(s) reference these definitions:"
@@ -2264,6 +2266,31 @@ notifyUser dir = \case
2264
2266
case syncErr of
2265
2267
Sync. TransportError te -> pure (prettyTransportError te)
2266
2268
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
+ ]
2267
2294
2268
2295
prettyShareError :: ShareError -> Pretty
2269
2296
prettyShareError =
0 commit comments