Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Oleg Babin <olegrok@tarantool.org>, tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH vshard 4/5] error: introduce from_string
Date: Sat, 18 Dec 2021 00:10:29 +0100	[thread overview]
Message-ID: <a686355f-193f-5007-d94d-b93d00398fc4@tarantool.org> (raw)
In-Reply-To: <cd08787f-b7d3-24c7-b91e-fa49a14d3005@tarantool.org>

Thanks for the review!

On 17.12.2021 12:09, Oleg Babin wrote:
> Thanks for your patch. LGTM.
> 
> However we should probably use more neutral name that doesn't touch implementation details.
> 
> Maybe in future we will use new native custom errors that are available in new Tarantool versions.
> 
> So probably it's better to call this method e.g. deserialize. Feel free to ignore.

I used from_string() to be consistent with tostring(). Deserialize() would
assume there is serialize(), but there isn't. Also it won't work if the error is
packed into MessagePack. It works for strings only. Hence mentioning the exact
type 'string' seems valid.

As for native errors - I agree. The existence of from_string() is a huge
crutch. I was lucky that the errors were encoded as json in vshard from
the beginning. So I have at least sometimes working way of getting the original
error from an exception.

We have 'custom' error types in latest Tarantools for about a year now,
but it is still hardly usable, because you can't attach any payload to it. Which
is often very important even if it has just 1-2 fields. I wish the product
managers would see usefulness of good errors API someday.

  reply	other threads:[~2021-12-17 23:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-17  0:25 [Tarantool-patches] [PATCH vshard 0/5] Router backoff, storage disable Vladislav Shpilevoy via Tarantool-patches
2021-12-17  0:25 ` [Tarantool-patches] [PATCH vshard 1/5] router: backoff on some box errors Vladislav Shpilevoy via Tarantool-patches
2021-12-17 11:09   ` Oleg Babin via Tarantool-patches
2021-12-17 23:10     ` Vladislav Shpilevoy via Tarantool-patches
2021-12-18 13:57       ` Oleg Babin via Tarantool-patches
2021-12-17  0:25 ` [Tarantool-patches] [PATCH vshard 2/5] storage: auto enable/disable Vladislav Shpilevoy via Tarantool-patches
2021-12-17 11:09   ` Oleg Babin via Tarantool-patches
2021-12-17 23:10     ` Vladislav Shpilevoy via Tarantool-patches
2021-12-18 13:58       ` Oleg Babin via Tarantool-patches
2021-12-17  0:25 ` [Tarantool-patches] [PATCH vshard 3/5] storage: manual enable/disable Vladislav Shpilevoy via Tarantool-patches
2021-12-17 11:09   ` Oleg Babin via Tarantool-patches
2021-12-17  0:25 ` [Tarantool-patches] [PATCH vshard 4/5] error: introduce from_string Vladislav Shpilevoy via Tarantool-patches
2021-12-17 11:09   ` Oleg Babin via Tarantool-patches
2021-12-17 23:10     ` Vladislav Shpilevoy via Tarantool-patches [this message]
2021-12-17  0:25 ` [Tarantool-patches] [PATCH vshard 5/5] router: backoff on storage being disabled Vladislav Shpilevoy via Tarantool-patches
2021-12-17 11:09   ` Oleg Babin via Tarantool-patches
2021-12-18 13:58 ` [Tarantool-patches] [PATCH vshard 0/5] Router backoff, storage disable Oleg Babin via Tarantool-patches
2021-12-20 23:52 ` Vladislav Shpilevoy via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a686355f-193f-5007-d94d-b93d00398fc4@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=olegrok@tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH vshard 4/5] error: introduce from_string' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox