File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import Unison.Cli.Monad qualified as Cli
1616import Unison.Cli.MonadUtils qualified as Cli
1717import Unison.Codebase (Codebase )
1818import Unison.Codebase qualified as Codebase
19+ import Unison.Codebase.Editor.Output (Output (.. ))
1920import Unison.Codebase.Path qualified as Path
2021import Unison.Codebase.ProjectPath qualified as PP
2122import Unison.Codebase.SqliteCodebase.Conversions qualified as Conversions
@@ -37,8 +38,10 @@ openUI path' = do
3738 Cli. Env {serverBaseUrl} <- ask
3839 defnPath <- Cli. resolvePath' path'
3940 pp <- Cli. getCurrentProjectPath
40- whenJust serverBaseUrl \ url -> do
41- openUIForProject url pp (defnPath ^. PP. absPath_)
41+ case serverBaseUrl of
42+ Just url -> openUIForProject url pp (defnPath ^. PP. absPath_)
43+ Nothing -> do
44+ Cli. respond UCMServerNotRunning
4245
4346openUIForProject :: Server. BaseUrl -> PP. ProjectPath -> Path. Absolute -> Cli ()
4447openUIForProject url pp@ (PP. ProjectPath project projectBranch perspective) defnPath = do
Original file line number Diff line number Diff line change @@ -465,6 +465,7 @@ data Output
465465 | SyncPullError (Sync. SyncError SyncV2. PullError )
466466 | SyncFromCodebaseMissingProjectBranch (ProjectAndBranch ProjectName ProjectBranchName )
467467 | OpenCodebaseError CodebasePath OpenCodebaseError
468+ | UCMServerNotRunning
468469
469470data MoreEntriesThanShown = MoreEntriesThanShown | AllEntriesShown
470471 deriving (Eq , Show )
@@ -709,6 +710,7 @@ isFailure o = case o of
709710 SyncPullError {} -> True
710711 SyncFromCodebaseMissingProjectBranch {} -> True
711712 OpenCodebaseError {} -> True
713+ UCMServerNotRunning -> True
712714
713715isNumberedFailure :: NumberedOutput -> Bool
714716isNumberedFailure = \ case
Original file line number Diff line number Diff line change @@ -2302,6 +2302,7 @@ notifyUser dir = \case
23022302 " The codebase is at schema version " <> P. shown currentSV <> " but UCM requires schema version " <> P. shown requiredSV <> " ." ,
23032303 " Please open the other codebase with UCM directly to upgrade it to the latest version, then try again."
23042304 ]
2305+ UCMServerNotRunning -> pure (P. wrap " The UCM server is not running." )
23052306
23062307prettyShareError :: ShareError -> Pretty
23072308prettyShareError =
You can’t perform that action at this time.
0 commit comments