Skip to content

Commit

Permalink
exception: replace 'BrokerPersistentException' with 'UnKnownException'
Browse files Browse the repository at this point in the history
  • Loading branch information
liangyepianzhou committed Dec 11, 2023
1 parent 64412a0 commit 501feb5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2123,7 +2123,7 @@ protected void handleGetLastMessageId(CommandGetLastMessageId getLastMessageId)
consumer.getSubscription().getName());
}).exceptionally(e -> {
writeAndFlush(Commands.newError(getLastMessageId.getRequestId(),
ServerError.PersistenceError, "Failed to recover Transaction Buffer."));
ServerError.UnknownError, "Failed to recover Transaction Buffer."));
return null;
});
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.Mockito.when;
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertTrue;
import static org.testng.AssertJUnit.fail;
import java.util.List;
import lombok.Cleanup;
Expand Down Expand Up @@ -236,7 +237,8 @@ public void testGetMaxPositionAfterTBReady() throws Exception {
try {
consumer.getLastMessageIds();
fail();
} catch (PulsarClientException.BrokerPersistenceException ignore) {
} catch (PulsarClientException exception) {
assertTrue(exception.getMessage().contains("Failed to recover Transaction Buffer."));
}
List<TopicMessageId> messageIdList = consumer.getLastMessageIds();
assertEquals(messageIdList.size(), 1);
Expand Down

0 comments on commit 501feb5

Please # to comment.