-
Notifications
You must be signed in to change notification settings - Fork 2.2k
API ServiceBusErrorSource to represent source of error #16710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
hemanttanwar
merged 37 commits into
Azure:master
from
hemanttanwar:sb-t2-errorsource-api
Oct 30, 2020
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
b0c8562
Designing ErrorSource options
b9a83ef
Merge branch 'master' into sb-t2-errorsource-api
aba06d0
Error source structure.
28fea7b
Adding error handling for Error source
d01190a
Adding error handling for Error source
1ec13b5
Adding error handling for Error source
bd05bfe
Removed error source from SBM context
3ce0cb3
Removed unwanted changes
36106a3
Added test case for sending and receiving the messages.
1d498ae
merge master into branch
46f7d2c
Added java doc
e8d7e1f
updated module info
cbc6f55
updated code to pass error source in updateDisposition
32aae8d
module info changes will be in separate PR
e34a23e
Updated based on review comments.
d9cd7c0
changes based on review comments
fce6f55
changes based on review comments
f84f896
changes based on review comments
2d004d8
Removed Error source from Sender as dotnet is also not doing it
5a52a8d
Removed Error source from Sender as dotnet is also not doing it
578a0dd
added error source for renew lock
eda86d1
added error source for renew lock
d24f339
added error source for renew lock
6e3b5d8
added docs for unit test
c90eb0e
Renamed Exception
3286f4c
Renamed Exception
b61551f
review comments incorporated
204fd28
Fixing checkstyle
47bfc0b
Incorporated review comments
e62f7f5
Review comments
4c11eb4
Review comments
59ff15f
Review comments
5b0d16a
Removed unwanted error source types
205fbfe
Fix unit test and ErrorSource only for AutoComplete on
62510bd
Review Comments
6d79df0
Fix unit test
0a6fea9
merge conflict resolution
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
...ging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusAmqpException.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| package com.azure.messaging.servicebus; | ||
|
|
||
| import com.azure.core.amqp.exception.AmqpException; | ||
|
|
||
| /** | ||
| * Defines {@link ServiceBusAmqpException} which has additional information about the operation that caused the error. | ||
| * | ||
| * @see ServiceBusErrorSource | ||
| */ | ||
| public final class ServiceBusAmqpException extends AmqpException { | ||
| private final transient ServiceBusErrorSource errorSource; | ||
|
|
||
| /** | ||
| * @param amqpException for the error hapened. | ||
| * @param errorSource indicating which api caused the error. | ||
| */ | ||
| ServiceBusAmqpException(AmqpException amqpException, ServiceBusErrorSource errorSource) { | ||
| super(amqpException.isTransient(), amqpException.getErrorCondition(), amqpException.getMessage(), | ||
| amqpException.getCause(), amqpException.getContext()); | ||
| this.errorSource = errorSource; | ||
| } | ||
|
|
||
| /** | ||
| * Gets the {@link ServiceBusErrorSource} in case of any errors. | ||
| * | ||
| * @return the {@link ServiceBusErrorSource} | ||
| */ | ||
| public ServiceBusErrorSource getErrorSource() { | ||
| return errorSource; | ||
| } | ||
| } |
39 changes: 39 additions & 0 deletions
39
...saging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusErrorSource.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| package com.azure.messaging.servicebus; | ||
|
|
||
| import com.azure.core.util.ExpandableStringEnum; | ||
|
|
||
| /** | ||
| * Represent the operation this sdk was performing when the error happened. | ||
| */ | ||
| public final class ServiceBusErrorSource extends ExpandableStringEnum<ServiceBusErrorSource> { | ||
|
|
||
| /** Error while abandoning the message.*/ | ||
| public static final ServiceBusErrorSource ABANDONED = fromString("ABANDONED", ServiceBusErrorSource.class); | ||
|
|
||
| /** Error while completing the message.*/ | ||
| public static final ServiceBusErrorSource COMPLETE = fromString("COMPLETE", ServiceBusErrorSource.class); | ||
|
|
||
| /** Error while receiving the message(s).*/ | ||
| public static final ServiceBusErrorSource RECEIVE = fromString("RECEIVE", ServiceBusErrorSource.class); | ||
|
|
||
| /** Error while renewing lock.*/ | ||
| public static final ServiceBusErrorSource RENEW_LOCK = fromString("RENEW_LOCK", ServiceBusErrorSource.class); | ||
|
|
||
| /** Error when we could not determine the source.*/ | ||
| public static final ServiceBusErrorSource UNKNOWN = fromString("UNKNOWN", ServiceBusErrorSource.class); | ||
|
|
||
| /** Error while user's code is running for a message.*/ | ||
| public static final ServiceBusErrorSource USER_CALLBACK = fromString("USER_CALLBACK", | ||
| ServiceBusErrorSource.class); | ||
|
|
||
| /** Error while session is accepted.*/ | ||
| public static final ServiceBusErrorSource ACCEPT_SESSION = fromString("ACCEPT_SESSION", | ||
| ServiceBusErrorSource.class); | ||
|
|
||
| /** Error while session is closed.*/ | ||
| public static final ServiceBusErrorSource CLOSE_SESSION = fromString("CLOSE_SESSION", | ||
| ServiceBusErrorSource.class); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.