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).
Showing
- src/lib/core/exception.cc 10 additions, 23 deletionssrc/lib/core/exception.cc
- src/lib/core/exception.h 0 additions, 2 deletionssrc/lib/core/exception.h
- src/lib/core/say.c 3 additions, 3 deletionssrc/lib/core/say.c
- src/lua/fio.c 2 additions, 2 deletionssrc/lua/fio.c
- test/app/on_shutdown.result 1 addition, 1 deletiontest/app/on_shutdown.result
- test/app/on_shutdown.test.lua 1 addition, 1 deletiontest/app/on_shutdown.test.lua
- test/box/cfg.result 1 addition, 1 deletiontest/box/cfg.result
- test/box/func_reload.result 2 additions, 2 deletionstest/box/func_reload.result
- test/box/func_reload.test.lua 1 addition, 1 deletiontest/box/func_reload.test.lua
- test/box/gh-6092-invalid-listen-uri.result 9 additions, 2 deletionstest/box/gh-6092-invalid-listen-uri.result
- test/box/gh-6092-invalid-listen-uri.test.lua 3 additions, 1 deletiontest/box/gh-6092-invalid-listen-uri.test.lua
- test/unit/fiber.result 1 addition, 1 deletiontest/unit/fiber.result
- test/unit/fiber_stack.result 1 addition, 1 deletiontest/unit/fiber_stack.result
- test/vinyl/errinj.result 1 addition, 1 deletiontest/vinyl/errinj.result
Loading
Please register or sign in to comment