Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
console: handle internal.format_yaml exceptions
Currently the call to internal.format_yaml in output_handlers["yaml"] is covered by pcall only for `status == true`, however the opposite case also can raise an exception. This patch adds the missed exception handling. Two distinct calls are required, because it is not possible to assing variadic arguments (...) to a variable if some of them is nil. If the first call fails, internal.format_yaml will be called for the second time. Hopefully, it will not fail during formatting of the error message received from libyaml. Before: ``` tarantool> require('net.box').self:call('\x80') LuajitError: builtin/box/console.lua:710: expected SCALAR, SEQUENCE-START, MAPPING-START, or ALIAS fatal error, exiting the event loop ~/test$ echo $? 0 ~/test$ ``` After: ``` tarantool> require('net.box').self:call('\x80') --- - error: 'console: an exception occurred when formatting the output: expected SCALAR, SEQUENCE-START, MAPPING-START, or ALIAS' ... tarantool> ``` Part of tarantool#6781 Part of tarantool#6934 NO_DOC=bugfix NO_TEST=see later commits NO_CHANGELOG=see later commits
- Loading branch information