Skip to content

Commit

Permalink
node_flat: Avoid catch-all clauses for RSM
Browse files Browse the repository at this point in the history
Apply the change made in the previous commit to Mnesia storage as well.
  • Loading branch information
weiss committed Aug 23, 2021
1 parent c952cc4 commit ebf03a3
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/node_flat.erl
Expand Up @@ -957,15 +957,12 @@ rsm_page(Count, Index, Offset, Items) ->
last = Last}.

encode_stamp(Stamp) ->
case catch xmpp_util:decode_timestamp(Stamp) of
{MS,S,US} -> {MS,S,US};
_ -> Stamp
try xmpp_util:decode_timestamp(Stamp)
catch _:{bad_timestamp, _} ->
Stamp % We should return a proper error to the client instead.
end.
decode_stamp(Stamp) ->
case catch xmpp_util:encode_timestamp(Stamp) of
TimeStamp when is_binary(TimeStamp) -> TimeStamp;
_ -> Stamp
end.
xmpp_util:encode_timestamp(Stamp).

transform({pubsub_state, {Id, Nidx}, Is, A, Ss}) ->
{pubsub_state, {Id, Nidx}, Nidx, Is, A, Ss};
Expand Down

0 comments on commit ebf03a3

Please sign in to comment.