aboutsummaryrefslogtreecommitdiffstats
path: root/packages/asset-buyer/src/asset_buyer.ts
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-10-03 06:44:11 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-10-03 06:44:11 +0800
commit75d6970e6c9bdeb6004228084bb541994b18e8c3 (patch)
tree2071cc854ca3e74a16e10e040ff911a40d64ed2a /packages/asset-buyer/src/asset_buyer.ts
parentb3a868da0e77da04b123f4ff397d8f1a3a4d3810 (diff)
downloaddexon-0x-contracts-75d6970e6c9bdeb6004228084bb541994b18e8c3.tar.gz
dexon-0x-contracts-75d6970e6c9bdeb6004228084bb541994b18e8c3.tar.zst
dexon-0x-contracts-75d6970e6c9bdeb6004228084bb541994b18e8c3.zip
Add AssetUnavailable error
Diffstat (limited to 'packages/asset-buyer/src/asset_buyer.ts')
-rw-r--r--packages/asset-buyer/src/asset_buyer.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/asset-buyer/src/asset_buyer.ts b/packages/asset-buyer/src/asset_buyer.ts
index 990369615..587e4e941 100644
--- a/packages/asset-buyer/src/asset_buyer.ts
+++ b/packages/asset-buyer/src/asset_buyer.ts
@@ -160,6 +160,9 @@ export class AssetBuyer {
this._getOrdersAndFillableAmountsAsync(zrxTokenAssetData, shouldForceOrderRefresh),
shouldForceOrderRefresh,
]);
+ if (ordersAndFillableAmounts.orders.length === 0) {
+ throw new Error(`${AssetBuyerError.AssetUnavailable}: For assetData ${assetData}`);
+ }
const buyQuote = buyQuoteCalculator.calculate(
ordersAndFillableAmounts,
feeOrdersAndFillableAmounts,