Skip to content
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

Added error codes for funding sources errors #30

Merged
merged 4 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,28 @@

## [1.0.3](https://github.com/ShipEngine/shipengine-java/compare/v1.0.2...v1.0.3) (2024-01-17)


### Bug Fixes

* update timeout to 60s ([f8bca01](https://github.com/ShipEngine/shipengine-java/commit/f8bca01e115aba99343f64de30282c25c13ea045))
- update timeout to 60s ([f8bca01](https://github.com/ShipEngine/shipengine-java/commit/f8bca01e115aba99343f64de30282c25c13ea045))

## 1.0.2 (2022-10-21)


### Bug Fixes

* Fixed exception handling
* Fixed bug in deriveUserAgent method in the InternalClient now reads sdk version from resources/project.properties instead of version.txt. ([2aa3d13](https://github.com/ShipEngine/shipengine-java/commit/2aa3d133756cfb311beb10bec3474dfad91bffef))
* Testing and linting working CI ([748d2ce](https://github.com/ShipEngine/shipengine-java/commit/748d2ceced376e0d66f895f5251ba166e70d9c5f))
* Updated pom.xml settings to fix JaCoCo coverage reporting bug. ([a91ef99](https://github.com/ShipEngine/shipengine-java/commit/a91ef99f29adf74e99478cc248291731be38ddff))
- Fixed exception handling
- Fixed bug in deriveUserAgent method in the InternalClient now reads sdk version from resources/project.properties instead of version.txt. ([2aa3d13](https://github.com/ShipEngine/shipengine-java/commit/2aa3d133756cfb311beb10bec3474dfad91bffef))
- Testing and linting working CI ([748d2ce](https://github.com/ShipEngine/shipengine-java/commit/748d2ceced376e0d66f895f5251ba166e70d9c5f))
- Updated pom.xml settings to fix JaCoCo coverage reporting bug. ([a91ef99](https://github.com/ShipEngine/shipengine-java/commit/a91ef99f29adf74e99478cc248291731be38ddff))

## 1.0.3

### Changes

* increase default timeout to 60s
- increase default timeout to 60s

## 1.0.4

### Changes

- Added error code FundingSourceMissingConfiguration
- Added error code FundingSourceError
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.shipengine</groupId>
<artifactId>shipengine</artifactId>
<version>1.0.3</version>
<version>1.0.4</version>

<name>ShipEngine SDK</name>
<description>The official Java SDK for ShipEngine API.</description>
Expand Down
29 changes: 16 additions & 13 deletions src/main/java/com/shipengine/exception/ShipEngineException.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ public enum ErrorType {
ERROR,
SECURITY,
SYSTEM,
VALIDATION
VALIDATION,
WALLET,
FUNDING_SOURCES
}

public enum ErrorCode {
Expand Down Expand Up @@ -81,7 +83,9 @@ public enum ErrorCode {
UNSPECIFIED,
VERIFICATION_CONFLICT,
WAREHOUSE_CONFLICT,
WEBHOOK_EVENT_TYPE_CONFLICT
WEBHOOK_EVENT_TYPE_CONFLICT,
FUNDING_SOURCE_MISSING_CONFIGURATION,
FUNDING_SOURCE_ERROR
}

/**
Expand All @@ -96,23 +100,26 @@ public enum ErrorCode {
* contact ShipEngine for support or if you should contact the carrier or
* marketplace instead.
*
* @see <a href="https://www.shipengine.com/docs/errors/codes/#error-source">...</a>
* @see <a href=
* "https://www.shipengine.com/docs/errors/codes/#error-source">...</a>
*/
private ErrorSource source;

/**
* Indicates the type of error that occurred, such as a validation error, a
* security error, etc.
*
* @see <a href="https://www.shipengine.com/docs/errors/codes/#error-type">...</a>
* @see <a href=
* "https://www.shipengine.com/docs/errors/codes/#error-type">...</a>
*/
private ErrorType type;

/**
* A code that indicates the specific error that occurred, such as missing a
* required field, an invalid address, a timeout, etc.
*
* @see <a href="https://www.shipengine.com/docs/errors/codes/#error-code">...</a>
* @see <a href=
* "https://www.shipengine.com/docs/errors/codes/#error-code">...</a>
*/
private ErrorCode code;

Expand Down Expand Up @@ -172,8 +179,7 @@ public ShipEngineException(
ErrorSource source,
ErrorType type,
ErrorCode code,
String url
) {
String url) {
super(message);
setRequestID(requestID);
setSource(source);
Expand All @@ -187,8 +193,7 @@ public ShipEngineException(
ErrorSource source,
ErrorType type,
ErrorCode code,
String url
) {
String url) {
super(message);
setSource(source);
setType(type);
Expand All @@ -201,8 +206,7 @@ public ShipEngineException(
String requestID,
String source,
String type,
String code
) {
String code) {
super(message);
setRequestID(requestID);
setSource(ErrorSource.valueOf(source.toUpperCase()));
Expand All @@ -214,8 +218,7 @@ public ShipEngineException(
String message,
String source,
String type,
String code
) {
String code) {
super(message);
setSource(ErrorSource.valueOf(source.toUpperCase()));
setType(ErrorType.valueOf(type.toUpperCase()));
Expand Down
Loading