chore(ds): make error handling slightly simpler

Co-Authored-By: Thales Macedo Garitezi <thalesmg@gmail.com>
This commit is contained in:
Andrew Mayorov 2024-03-05 20:26:53 +01:00
parent b604c3dbd4
commit 09905d78cd
No known key found for this signature in database
GPG Key ID: 2837C62ACFBFED5D
1 changed files with 2 additions and 3 deletions

View File

@ -171,9 +171,8 @@ drop_db(DB) ->
-spec store_batch(emqx_ds:db(), [emqx_types:message(), ...], emqx_ds:message_store_opts()) -> -spec store_batch(emqx_ds:db(), [emqx_types:message(), ...], emqx_ds:message_store_opts()) ->
emqx_ds:store_batch_result(). emqx_ds:store_batch_result().
store_batch(DB, Messages, Opts) -> store_batch(DB, Messages, Opts) ->
try emqx_ds_replication_layer_egress:store_batch(DB, Messages, Opts) of try
ok -> emqx_ds_replication_layer_egress:store_batch(DB, Messages, Opts)
ok
catch catch
error:{Reason, _Call} when Reason == timeout; Reason == noproc -> error:{Reason, _Call} when Reason == timeout; Reason == noproc ->
{error, recoverable, Reason} {error, recoverable, Reason}