We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bedc854 commit 3aac3cdCopy full SHA for 3aac3cd
1 file changed
src/util/fetch.js
@@ -20,5 +20,12 @@ module.exports = async (url, options = {}) => {
20
},
21
})
22
.then((res) => ({ data: res.body }))
23
- .catch((error) => ({ error }));
+ .catch((error) => {
24
+ const { body } = error.response;
25
+
26
+ if (typeof body == 'object' && body.message)
27
+ error.message = body.message;
28
29
+ return { error };
30
+ });
31
};
0 commit comments