Skip to content
Snippets Groups Projects
Commit 29026b19 authored by Vladimir Davydov's avatar Vladimir Davydov Committed by Vladimir Davydov
Browse files

error: append strerror(errno) to SystemError and SocketError errmsg

Currently, we append strerror(errno) when logging those errors while
error::errmsg only contains the message passed to the error constructor,
which usually points at the system call that failed, e.g. sio_connect()
sets it to

  connect, called on fd 50, aka 127.0.0.1:33728

Errno can shed light at the reason of failure so we'd better append it
to errmsg too:

  connect, called on fd 50, aka 127.0.0.1:33728: Connection refused

In particular, this improves error messages returned by the net.box
state machine, which was recently switched to diag, see commit
c13b3a31 ("net.box: rewrite state
machine (transport) in C").

After this patch, we don't need to append strerror(errno) to SystemError
message manually anymore so this patch also walks over the whole code
base and removes strerror from diag_set calls - there are just two
modules that do that, fio and say.

Also, this patch slightly changes logged error messages:
 - A colon (:) is printed after SystemError, because SystemError::log
   doesn't override Exception::log anymore. This makes SystemError
   logging consistent with other error logging.
 - For the same reason we now print the actual error type of errors
   derived from SystemError (SocketError, OutOfMemory and TimedOut)
   instead of SystemError to the log (this should be fine), and don't
   print strerror(errno) for OutOfMemory and TimedOut (it's useless
   anyway).
parent 871f5a7f
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment