faldor20 / jj_tui

A TUI for the Jujutsu version control system
MIT License
28 stars 0 forks source link

Long error message if run outside a jj repo #2

Closed ilyagr closed 3 months ago

ilyagr commented 3 months ago

I tried running jj_tui outside a jj repo and it didn't work:

$ ~/.local/bin/jj_tui
Fatal error: exception Failure("Getting files should always return a list of file names with a modifier at the start ")
Raised at Eio__core__Promise.await_exn in file "lib_eio/core/promise.ml", line 71, characters 16-24
Called from Dune__exe__Global_funcs.update_status.(fun) in file "jj_tui/bin/global_funcs.ml", line 50, characters 19-51
Called from Eio__core__Switch.run_internal in file "lib_eio/core/switch.ml", line 133, characters 8-12
Re-raised at Eio__core__Switch.maybe_raise_exs in file "lib_eio/core/switch.ml", line 119, characters 21-56
Called from Eio__core__Switch.run_internal in file "lib_eio/core/switch.ml", line 149, characters 4-21
Called from Eio__core__Cancel.with_cc in file "lib_eio/core/cancel.ml", line 118, characters 8-12
Re-raised at Eio__core__Cancel.with_cc in file "lib_eio/core/cancel.ml", line 120, characters 50-58
Called from Dune__exe__Jj_ui.Make.mainUi in file "jj_tui/bin/jj_ui.ml", line 108, characters 4-41
Called from Dune__exe__Main.start_ui.(fun) in file "jj_tui/bin/main.ml", line 51, characters 32-54
Called from Eio__core__Switch.run_internal in file "lib_eio/core/switch.ml", line 133, characters 8-12
Re-raised at Eio__core__Switch.maybe_raise_exs in file "lib_eio/core/switch.ml", line 119, characters 21-56
Called from Eio__core__Switch.run_internal in file "lib_eio/core/switch.ml", line 149, characters 4-21
Called from Eio__core__Cancel.with_cc in file "lib_eio/core/cancel.ml", line 118, characters 8-12
Re-raised at Eio__core__Cancel.with_cc in file "lib_eio/core/cancel.ml", line 120, characters 50-58
Called from Eio__core__Switch.run_internal in file "lib_eio/core/switch.ml", line 133, characters 8-12
Re-raised at Eio__core__Switch.maybe_raise_exs in file "lib_eio/core/switch.ml", line 119, characters 21-56
Called from Eio__core__Switch.run_internal in file "lib_eio/core/switch.ml", line 149, characters 4-21
Called from Eio__core__Cancel.with_cc in file "lib_eio/core/cancel.ml", line 118, characters 8-12
Re-raised at Eio__core__Cancel.with_cc in file "lib_eio/core/cancel.ml", line 120, characters 50-58
Called from Eio_posix__Sched.with_op in file "lib_eio_posix/sched.ml", line 318, characters 8-12
Re-raised at Eio_posix__Sched.with_op in file "lib_eio_posix/sched.ml", line 324, characters 4-12
Called from Eio_posix__Sched.run.(fun) in file "lib_eio_posix/sched.ml", line 386, characters 29-47
Called from Eio_unix__Thread_pool.run in file "lib_eio/unix/thread_pool.ml", line 108, characters 8-13
Re-raised at Eio_unix__Thread_pool.run in file "lib_eio/unix/thread_pool.ml", line 113, characters 4-39
Re-raised at Eio_posix__Sched.run.fork.(fun) in file "lib_eio_posix/sched.ml", line 342, characters 12-76
Called from Stdlib__Fun.protect in file "fun.ml", line 33, characters 8-15
Re-raised at Stdlib__Fun.protect in file "fun.ml", line 38, characters 6-52
Called from Eio_posix__Sched.run in file "lib_eio_posix/sched.ml", line 381, characters 4-303
Called from Eio_posix__Sched.with_sched in file "lib_eio_posix/sched.ml", line 258, characters 8-12
Re-raised at Eio_posix__Sched.with_sched in file "lib_eio_posix/sched.ml", line 263, characters 4-39
Called from Dune__exe__Main.start in file "jj_tui/bin/main.ml", line 54, characters 15-79

This is on MacOS, the binary was donloaded form https://github.com/faldor20/jj_tui/releases/download/v0.2.3/jj_tui_macos.tar.gz .

faldor20 commented 3 months ago

Hey, It works on macos! I'll fix that bug as well. Thanks for testing, I'm stoked my build actually works though.

ilyagr commented 3 months ago

Ah, yes, verifying this was my original goal when trying the binary. So far, it works great on MacOS! 🎉

faldor20 commented 3 months ago

Just pushed out v0.3 and your bug should be fixed, thanks again for your help!

ilyagr commented 3 months ago

I see the same problem with https://github.com/faldor20/jj_tui/releases/download/v0.3/jj_tui_macos.tar.gz .

I also get this problem if jj is not in the PATH.

ilyagr commented 3 months ago

Also, perhaps you should rename jj_tui_macos.tar.gz to jj_tui_macos-aarch64.tar.gz and jj_tui_linux to jj_tui_linux-x64_86? Some people still use MacOS on Intel, and I use Linux on aarch64.

faldor20 commented 3 months ago

Fair point. I'll take care of that too. I'm not sure why you're still getting that same error, but I'll fix the missing path problem and hopefully that'll fix it all

faldor20 commented 3 months ago

Okay @ilyagr I have introduced a general error handling system, which was on the todo anyway. That should handle all cases where there is an error either on startup or running a command. v0.4 is out now Thanks for your help :)