Add AssetUnavailable error
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -96,13 +96,7 @@ export enum AssetBuyerError {
|
||||
InsufficientZrxLiquidity = 'INSUFFICIENT_ZRX_LIQUIDITY',
|
||||
NoAddressAvailable = 'NO_ADDRESS_AVAILABLE',
|
||||
InvalidOrderProviderResponse = 'INVALID_ORDER_PROVIDER_RESPONSE',
|
||||
}
|
||||
|
||||
/**
|
||||
* Possible errors thrown by an AssetBuyerManager instance or associated static methods.
|
||||
*/
|
||||
export enum AssetBuyerManagerError {
|
||||
AssetBuyerNotFound = 'ASSET_BUYER_NOT_FOUND',
|
||||
AssetUnavailable = 'ASSET_UNAVAILABLE',
|
||||
}
|
||||
|
||||
export interface OrdersAndFillableAmounts {
|
||||
|
||||
Reference in New Issue
Block a user