Skip to content

API ServiceBusErrorSource to represent source of error#16710

Merged
hemanttanwar merged 37 commits into
Azure:masterfrom
hemanttanwar:sb-t2-errorsource-api
Oct 30, 2020
Merged

API ServiceBusErrorSource to represent source of error#16710
hemanttanwar merged 37 commits into
Azure:masterfrom
hemanttanwar:sb-t2-errorsource-api

Conversation

@hemanttanwar

@hemanttanwar hemanttanwar commented Oct 22, 2020

Copy link
Copy Markdown
Contributor

Introduce ServiceBusErrorSource, to help user identify source of the error. Specially in error handler in processor model.

/**

  • Represent the scenario in which user was when the error happened.
    */
    public enum ServiceBusErrorSource {
    SEND,
    RECEIVE,
    APPEND,
    COMPLETE,
    DEFER,
    DEAD_LETTER,
    PEEK;
    }

Also removing unwanted opens statements from module info as they are not needed.

@ghost ghost added the Service Bus label Oct 22, 2020
@hemanttanwar
hemanttanwar marked this pull request as ready for review October 27, 2020 08:20
Comment thread sdk/servicebus/azure-messaging-servicebus/src/main/java/module-info.java Outdated
@hemanttanwar
hemanttanwar requested a review from conniey October 27, 2020 21:02
@hemanttanwar
hemanttanwar requested a review from conniey October 28, 2020 18:12
.verifyErrorMatches(throwable -> {
Assertions.assertTrue(throwable instanceof ServiceBusAmqpException);
final ServiceBusErrorSource actual = ((ServiceBusAmqpException) throwable).getErrorSource();
Assertions.assertEquals(ServiceBusErrorSource.RECEIVE, actual);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also have tests for error source UNKNOWN?

@hemanttanwar
hemanttanwar requested a review from srnagar October 29, 2020 09:06

@conniey conniey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@hemanttanwar
hemanttanwar merged commit 249ecc1 into Azure:master Oct 30, 2020
@hemanttanwar
hemanttanwar deleted the sb-t2-errorsource-api branch October 30, 2020 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants