error: move errno into an error object
The only error type having an errno as a part of it was SystemError (and its descendants SocketError, TimedOut, OOM, ...). That was used in logs (SystemError::log() method), and exposed to Lua (if type was SystemError, an error object had 'errno' field). But actually errno might be useful not only there. For example, box.info.replication exposes the latest error message of applier/relay as 'message' field of 'upstream/downstream' fields, lacking errno description. Before the patch it was impossible to obtain an errno code from C, because it was necessary to check whether an error has SystemError type, cast to SystemError class, and call SystemError::get_errno() method. Now errno is available as a part of struct error object (available from C), and is not 0 for system errors. Part of #4402
Showing
- src/box/applier.cc 1 addition, 1 deletionsrc/box/applier.cc
- src/lib/core/diag.c 1 addition, 0 deletionssrc/lib/core/diag.c
- src/lib/core/diag.h 6 additions, 0 deletionssrc/lib/core/diag.h
- src/lib/core/exception.cc 8 additions, 14 deletionssrc/lib/core/exception.cc
- src/lib/core/exception.h 0 additions, 5 deletionssrc/lib/core/exception.h
- src/lua/error.lua 10 additions, 0 deletionssrc/lua/error.lua
- test/box/misc.result 19 additions, 0 deletionstest/box/misc.result
- test/box/misc.test.lua 10 additions, 0 deletionstest/box/misc.test.lua
Loading
Please register or sign in to comment