class SystemCallError

Public Instance Methods

strerror() click to toggle source
# File lib/ugh.rb, line 77
def strerror
  # Remove in-sentence bits of context such as filename(s)
  # by looking up the error message without context:
  m = SystemCallError.new(errno).message

  # Fix message case by downcasing the initial uppercase
  # letter except if it's immediately followed by another
  # uppercase letter, as in [["RPC version wrong"]]:
  m = m.sub(/\A[[:upper:]](?![[:upper:]])/){$&.downcase}

  return m
end