Skip to content

Commit

Permalink
Merge pull request #1857 from oceanprotocol/issue-1856-improve-error
Browse files Browse the repository at this point in the history
throw some error msgs if no tx
  • Loading branch information
paulo-ocean authored Sep 25, 2024
2 parents 443d748 + c701652 commit 5136d10
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/OrderUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export async function orderAsset(
)
const txApprove = typeof tx !== 'number' ? await tx.wait() : tx
if (!txApprove) {
throw new Error(`Failed to appove ${exchange.baseToken} !`)
throw new Error(`Failed to approve ${exchange.baseToken} !`)
}
const freTx = await fre.buyDatatokens(
exchange.exchangeId,
Expand Down Expand Up @@ -221,11 +221,11 @@ export async function orderAsset(
false
)
if (!tx) {
return
throw new Error(`Failed to approve ${exchange.baseToken} !`)
}
const txApprove = typeof tx !== 'number' ? await tx.wait() : tx
if (!txApprove) {
return
throw new Error(`Failed to confirm/mine approval transaction!`)
}
const txBuy = await datatoken.buyFromFreAndOrder(
asset.datatokens[datatokenIndex].address,
Expand Down

0 comments on commit 5136d10

Please sign in to comment.