Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

factor out remaining occurrences of ExitFail not in cmd/main.go or paths used by just CLI #106

Open
naggie opened this issue Jan 19, 2021 · 1 comment
Labels
good first issue Good for newcomers

Comments

@naggie
Copy link
Owner

naggie commented Jan 19, 2021

And possibly Must* style methods.

This is necessary due to the ongoing development of a dstask web interface by @botto

@naggie naggie modified the milestone: 0.24 Jan 19, 2021
@naggie naggie changed the title factor out remaining occurrences of ExitFail not in cmd/main.go factor out remaining occurrences of ExitFail not in cmd/main.go or paths used by just CLI Jan 20, 2021
@dontlaugh
Copy link
Contributor

Here is a ripgrep command that might find what we are looking for in this issue, e.g. "ExitFail" not under the path cmd/

 rg -g '!cmd' -F ExitFail
Results:
task.go
279:			ExitFail("Could not remove task %s: %v", filepath, err)
292:			ExitFail("Failed to marshal task %s", t)
297:			ExitFail("Failed to write task %s", t)
312:				ExitFail("Could not remove task %s: %v", filepath, err)

localstate.go
64:		ExitFail("Failed to open %s for writing: ", filePath)
73:		ExitFail("Failed to encode state gob: %s, %s", filePath, err)
81:		ExitFail("Failed to open %s for reading: ", filePath)
90:		ExitFail("Failed to parse state gob: %s, %s", filePath, err)

git.go
21:		ExitFail("Failed to run git cmd.")
34:		ExitFail("error: %s", err)
80:			ExitFail("Failed to create directory in git repository")
91:		ExitFail("git required, please install")
102:			ExitFail("Failed to create directory in git repository")

query.go
188:			ExitFail("Could not apply q2, project conflict")
196:			ExitFail("Could not apply q2, priority conflict")

commands.go
301:				ExitFail("Could not write to stdout: %v", err)

taskset.go
148:		ExitFail("%s, task %s", err, task.UUID)
204:		ExitFail(err.Error())
274:		ExitFail(err.Error())

util.go
16:func ExitFail(format string, a ...interface{}) {
34:	ExitFail("Aborted.")
92:		ExitFail("Could not create temporary file to edit")
100:		ExitFail("Could not write to temporary file to edit")
105:		ExitFail("Failed to run $EDITOR")
111:		ExitFail("Could not read back temporary edited file")
175:		ExitFail("unsupported platform")
179:		ExitFail("Failed to open browser")
204:		ExitFail("Not a TTY")

display.go
70:		ExitFail("No matching tasks in given context or filter.")

@naggie naggie added the good first issue Good for newcomers label Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants