Skip to content

Commit

Permalink
Merge pull request ocaml#5712 from rjbou/partially-installed
Browse files Browse the repository at this point in the history
switch: more precise message for fatal error on switch creation
  • Loading branch information
kit-ty-kate authored Dec 12, 2023
2 parents a1cdd7c + 73b6b15 commit 173e833
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ users)
## Remove

## Switch
* Precise message for Ctrl-c-ed opam switch creation "Switch left partially installed" [#5713 @rjbou - fix #5710]

## Config

Expand Down
6 changes: 5 additions & 1 deletion src/client/opamSwitchCommand.ml
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,11 @@ let create
let () =
try OpamStd.Exn.fatal e with e ->
OpamStd.Exn.finalise e @@ fun () ->
OpamConsole.warning "Switch %s left partially installed"
OpamConsole.error
"Switch %s left %s installed.\n\
To clean it, use 'opam switch remove %s'"
(OpamConsole.colorise `underline (OpamSwitch.to_string st.switch))
(OpamConsole.colorise `bold "partially")
(OpamSwitch.to_string st.switch)
in
OpamStd.Exn.finalise e @@ fun () ->
Expand Down

0 comments on commit 173e833

Please sign in to comment.