[Tarantool-patches] [PATCH V4 4/6] error: add session setting for error type marshaling

Konstantin Osipov kostja.osipov at gmail.com
Thu Apr 16 22:48:35 MSK 2020


* Leonid Vasiliev <lvasiliev at tarantool.org> [20/04/16 20:45]:
> Errors are encoded as a string when serialized to MessagePack to
> be sent over IProto or when just saved into a buffer via Lua
> modules msgpackffi and msgpack.
> 
> That is not very useful on client-side, because most of the error
> metadata is lost: code, type, trace - everything except the
> message.
> 
> Next commits are going to dedicate a new MP_EXT type to error
> objects so as everything could be encoded, and on client side it
> would be possible to restore types.
> 
> But this is a breaking change in case some users use old
> connectors when work with newer Tarantool instances. So to smooth
> the upgrade there is a new session setting -
> 'error_marshaling_enabled'.
> 
> By default it is false. When it is true, all fibers of the given
> session will serialize error objects as MP_EXT.

I don't understand the point of having an MP_EXT if the same
can be achieved with simply a new messagepack key. There is
already IPROTO_ERROR_CODE, IPROTO_ERROR_MESSAGE, why can't you add
IPROTO_ERROR_TYPE? 

And since this is a protocol change, there should have been (a
short?) RFC for it.

-- 
Konstantin Osipov, Moscow, Russia


More information about the Tarantool-patches mailing list