Skip to content

Commit eb56282

Browse files
authored
Merge pull request #484 from Ecwid/ECWID-161397
ECWID-161397 - add new field 'args' to EcwidApiError
2 parents 3494239 + d89c3a7 commit eb56282

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

src/main/kotlin/com/ecwid/apiclient/v3/ApiClientHelper.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ class ApiClientHelper private constructor(
204204
statusCode = httpResponse.statusCode,
205205
reasonPhrase = httpResponse.reasonPhrase,
206206
code = ecwidError?.errorCode,
207-
message = ecwidError?.errorMessage
207+
message = ecwidError?.errorMessage,
208+
args = ecwidError?.args,
208209
)
209210
} catch (e: JsonDeserializationException) {
210211
throw EcwidApiException(

src/main/kotlin/com/ecwid/apiclient/v3/dto/common/EcwidApiError.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ package com.ecwid.apiclient.v3.dto.common
22

33
data class EcwidApiError(
44
val errorMessage: String? = null,
5-
val errorCode: String? = null
5+
val errorCode: String? = null,
6+
val args: Map<String, String>? = null,
67
)

src/main/kotlin/com/ecwid/apiclient/v3/exception/EcwidApiException.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ data class EcwidApiException(
55
val reasonPhrase: String? = null,
66
val code: String? = null,
77
override val message: String? = null,
8-
override val cause: Throwable? = null
8+
val args: Map<String, String>? = null,
9+
override val cause: Throwable? = null,
910
) : Exception(message, cause)

src/test/kotlin/com/ecwid/apiclient/v3/util/OrderUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ fun generateTestOrder(): UpdatedOrder {
104104

105105
shippingOption = UpdatedOrder.ShippingOption(
106106
shippingMethodId = "MethodId " + randomAlphanumeric(8),
107-
shippingCarrierName = "Carrier " + randomAlphanumeric(8),
107+
shippingCarrierName = null, // not saved for pickup, see ECWID-153335
108108
shippingMethodName = "Method " + randomAlphanumeric(8),
109109
shippingRate = randomPrice(),
110110
estimatedTransitTime = "Estimates " + randomAlphanumeric(8),

0 commit comments

Comments
 (0)