Skip to content

Commit

Permalink
ad: 透传原生新增错误参数 detail
Browse files Browse the repository at this point in the history
  • Loading branch information
dcloudhdx committed Oct 13, 2022
1 parent 1d55302 commit 5b50f88
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/uni-cli-shared/components/ad.mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,14 @@ class AdBase {
})
ad.onError(({
code,
message
message,
detail
}) => {
this._isLoading = false
const data = {
code: code,
errMsg: message
errMsg: message,
detail: detail
}

if (this._retry && code === -5008) {
Expand Down
5 changes: 4 additions & 1 deletion src/platforms/app-plus/service/api/ad/ad-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ class AdBase {

const data = {
code: e.code,
errMsg: e.message
errCode: e.code,
errMsg: e.message,
detail: e.detail
}

this._adError = data
Expand All @@ -74,6 +76,7 @@ class AdBase {
const error = new Error(JSON.stringify(this._adError))
error.code = e.code
error.errMsg = e.message
error.detail = e.detail

if (this._loadPromiseReject != null) {
this._loadPromiseReject(error)
Expand Down

0 comments on commit 5b50f88

Please sign in to comment.