-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #156 from mobsuccess-devops/feat/replace-retry
feat: replace retry sdk v1 with sdk v2
- Loading branch information
Showing
2 changed files
with
63 additions
and
26 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
src/main/java/software/amazon/msk/auth/iam/CompatibilityHelper.java
This file contains 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,23 @@ | ||
package software.amazon.msk.auth.iam; | ||
|
||
import software.amazon.awssdk.core.exception.SdkClientException; | ||
import software.amazon.awssdk.core.exception.SdkException; | ||
|
||
public class CompatibilityHelper { | ||
|
||
/** | ||
* Convert an exception to an SdkException | ||
* | ||
* @param e Exception to convert | ||
* @return SdkException | ||
*/ | ||
public static SdkException toSdkException(Exception e) { | ||
if (e instanceof com.amazonaws.SdkClientException) { | ||
return SdkClientException.create(e.getMessage(), e.getCause()); | ||
} else if (e instanceof SdkException) { | ||
return (SdkException) e; | ||
} else { | ||
return SdkException.create(e.getMessage(), e); | ||
} | ||
} | ||
} |
This file contains 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