Where do error messages from `panic(err) go? #114
Labels
No Label
blocked
bug
build
documentation
duplicate
enhancement
finger
gemini
gopher
help wanted
http
in progress
invalid
local
needs-info
non-code
non-functional
non-urgent
question
release
rendering
suggestion
telnet
terminal
urgent
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sloum/bombadillo#114
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
(As per #113)
If the client can't initialise for some reason, like if the terminal can't be set up, or if the config file can't be created, the client panics.
It seems that when the panic occurs, the error message should be displayed to the console, but it is not displayed.
That is because of our
defer cui.Exit()
I believe. Oncecui.Init()
is called we are on the alternate screen buffer for the terminal. Because we usedefer cui.Exit()
, that is the last thing that is run....always. Which means any messaging that prints will get cleared out by exiting the alternate screen buffer.Something that could allow for some flexibility with that while ensuring we still always leave the buffer is to add in a print statement in
.cui.Exit()
. That print statement can print the value of a string pointer. That string pointer can be updated in places that panic would otherwise be called. That way we still print after the switch of screen buffers.I had thought that panic would prevent the
defer
from running, but I guess that is not the case?The above proposed methodology might work out better for us anyway and provide guarantees that the terminal resumes its normal modes.
Closed by #115