Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-8861

Clean up error handling



    • Task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None


      First, os::strerror should be deleted (at least on Windows), and errno should almost never be used, instead preferring ErrnoError.

      Second, WindowsError and WSASocketError are redundant. They are distinguishable only in that the former calls GetLastError and the latter calls WSAGetLastError, but these functions are aliases of each other. This abstraction also introduced the redundant SocketError, which is aliased to ErrnoError on Linux and WSASocketError on Windows. With Windows no longer using the CRT, we could conceivably have a SystemError which is correctly Errno or Windows depending on the platform.

      Third, but this is unlikely to happen, Try<T, Error> should start returning the Error instead of the string, as we frequently need access to its code, but can't get it because Try is unfortunately wired to instead return the error message string if it's typed on Error. This is bizarre because it will return the Error class if it's instead Try<T, ErrnoError> etc. If we could also get the Error back, we could stop writing code that checks errno on POSIX and GetLastError() on Windows manually.


        Issue Links



              Unassigned Unassigned
              andschwa Andrew Schwartzmeyer
              Andrew Schwartzmeyer Andrew Schwartzmeyer
              0 Vote for this issue
              1 Start watching this issue