Skip to content

Short urls for error messages? #380

Closed

Description

@jpjp

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

Activity

  1. calmh commented on Jun 19, 2014

    @calmh
    Member

    Good idea.

  2. calmh commented on Aug 5, 2014

    @calmh
    Member

    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.

  3. Nutomic commented on Aug 5, 2014

    @Nutomic
    Contributor

    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?

  4. calmh commented on Aug 5, 2014

    @calmh
    Member

    No

  5. added
    frozen-due-to-age
    on Jun 17, 2017
  6. locked and limited conversation to collaborators on Jun 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    frozen-due-to-age

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions