You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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?
Activity
calmh commentedon Jun 19, 2014
Good idea.
calmh commentedon 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.
where
erris 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.Nutomic commentedon 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 commentedon Aug 5, 2014
No