From f7b78f6d0f76bd2d12c7135df6d1a9c53853a2b6 Mon Sep 17 00:00:00 2001 From: anatolykopyl Date: Sat, 2 Jul 2022 18:58:00 +0300 Subject: [PATCH] Return empty orders on error --- gather/src/api.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gather/src/api.js b/gather/src/api.js index b23f573..bc427e4 100644 --- a/gather/src/api.js +++ b/gather/src/api.js @@ -10,7 +10,16 @@ class Api { async _get (url) { await this.limiter.removeTokens(1) - return axios.get(url).catch(console.error) + return axios.get(url).catch((error) => { + console.error(error) + return { + data: { + payload: { + orders: [] + } + } + } + }) } async getOrders (url) {