优化 不在频繁报错 试 91 订单失败
This commit is contained in:
@@ -485,6 +485,9 @@ async function syncOpen91OrderAfterSendCallbackSuccess(
|
|||||||
taskCount: result.tasks.length,
|
taskCount: result.tasks.length,
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
if (isOpen91OrderAwaitingFulfillmentConfig(error)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
logIntegration(
|
logIntegration(
|
||||||
'[kuaishou-industry/send-code]',
|
'[kuaishou-industry/send-code]',
|
||||||
'电子凭证发货回调成功后重试 91 订单失败',
|
'电子凭证发货回调成功后重试 91 订单失败',
|
||||||
@@ -499,6 +502,15 @@ async function syncOpen91OrderAfterSendCallbackSuccess(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isOpen91OrderAwaitingFulfillmentConfig(error: unknown) {
|
||||||
|
return Boolean(
|
||||||
|
error &&
|
||||||
|
typeof error === 'object' &&
|
||||||
|
String((error as { errorCode?: unknown }).errorCode || '').trim() ===
|
||||||
|
'open91_order_still_unconfigured',
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
function isRetriableSendCallbackFailure(result: Awaited<ReturnType<typeof sendCallback>>) {
|
function isRetriableSendCallbackFailure(result: Awaited<ReturnType<typeof sendCallback>>) {
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
return false
|
return false
|
||||||
|
|||||||
Reference in New Issue
Block a user