Skip to content

Commit

Permalink
fix: improve error logging (#435)
Browse files Browse the repository at this point in the history
* fix: improve error logging

* fix typo
  • Loading branch information
akvlad authored Jan 19, 2024
1 parent 3ac5c4c commit 526b45c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/db/throttler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 526b45c

Please sign in to comment.