aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/instant/src/util/error.ts13
1 files changed, 12 insertions, 1 deletions
diff --git a/packages/instant/src/util/error.ts b/packages/instant/src/util/error.ts
index 78d056e11..48cb131a9 100644
--- a/packages/instant/src/util/error.ts
+++ b/packages/instant/src/util/error.ts
@@ -28,11 +28,22 @@ class ErrorFlasher {
}
const humanReadableMessageForError = (error: Error, assetData?: string): string | undefined => {
- if (error.message === AssetBuyerError.InsufficientAssetLiquidity) {
+ const hasInsufficientLiquidity =
+ error.message === AssetBuyerError.InsufficientAssetLiquidity ||
+ error.message === AssetBuyerError.InsufficientZrxLiquidity;
+ if (hasInsufficientLiquidity) {
const assetName = assetDataUtil.bestNameForAsset(assetData, 'of this asset');
return `Not enough ${assetName} available`;
}
+ if (
+ error.message === AssetBuyerError.StandardRelayerApiError ||
+ error.message.startsWith(AssetBuyerError.AssetUnavailable)
+ ) {
+ const assetName = assetDataUtil.bestNameForAsset(assetData, 'This asset');
+ return `${assetName} is currently unavailable`;
+ }
+
return undefined;
};