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

Short urls for error messages? #380

Closed
jpjp opened this issue Jun 19, 2014 · 4 comments
Closed

Short urls for error messages? #380

jpjp opened this issue Jun 19, 2014 · 4 comments
Labels
frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion

Comments

@jpjp
Copy link
Contributor

jpjp commented Jun 19, 2014

How about adding short urls to error messages to find out an explanation? It might cut down on duplicate questions on the discourse board.

@calmh
Copy link
Member

calmh commented Jun 19, 2014

Good idea.

@calmh
Copy link
Member

calmh commented Aug 5, 2014

I started looking into doing this, but it turns out to be tricky. With few exceptions, Syncthing just reports a random error generated somewhere else, i.e.

jb@jborg-mbp:~/src/github.com/syncthing/syncthing (master) $ git grep 'l.Warn'
beacon/beacon.go:                       l.Warnln("Beacon read:", err)
beacon/beacon.go:                       l.Warnln("Beacon: interface addresses:", err)
cmd/syncthing/gui.go:           l.Warnln(err)
cmd/syncthing/gui.go:                           l.Warnln(err)
cmd/syncthing/gui.go:           l.Warnln(err)
cmd/syncthing/gui.go:                   l.Warnln(err)
cmd/syncthing/gui_solaris.go:                   l.Warnln(err)
cmd/syncthing/main.go:                  l.Warnln("Key exists; will not overwrite.")
cmd/syncthing/main.go:          l.Warnln("Invalid lock port %q: %v", lockPortStr, err)
...etc etc

where err is an error description received from the operating system along the lines of "connection refused", "permission denied", "no space left on device" or the classic "EOF". To be able to categorize these usefully we'd have to parse the returned error string and look for patterns, which are obviously platform specific (i.e. entirely different on Windows than Linux etc). As such, I don't see how to implement this.

@calmh calmh added wontfix and removed enhancement labels Aug 5, 2014
@Nutomic
Copy link
Contributor

Nutomic commented Aug 5, 2014

Does Go not use error classes, like Java has Exception classes (with inheritance and all)?

If not, you might want to create your own classes wherever you throw the error (or see it for the first time if it's coming somewhere external), and then check the error class later?

@calmh
Copy link
Member

calmh commented Aug 5, 2014

No

@calmh calmh closed this as completed Aug 12, 2014
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Jun 17, 2017
@syncthing syncthing locked and limited conversation to collaborators Jun 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion
Projects
None yet
Development

No branches or pull requests

4 participants