diff --git a/lib/db/throttler.js b/lib/db/throttler.js index 8d84495e..d1da0529 100644 --- a/lib/db/throttler.js +++ b/lib/db/throttler.js @@ -16,7 +16,11 @@ const axiosError = async (err) => { err.response.data.on('data', data => { err.responseData += data }) await new Promise((resolve) => err.response.data.once('end', resolve)) } - return err + if (typeof resp.data === 'string') { + err.responseData = resp.data + } + return new Error('AXIOS ERROR: ' + err + + (err.responseData ? ' Response data: ' + err.responseData : '')) } } catch (e) { return err