Better errors

This commit is contained in:
hiimgoodpack 2021-01-23 12:27:53 -05:00
parent 04b534b596
commit ea15842113
Signed by: hiimgoodpack
GPG key ID: 4E0E62733C14AE69

View file

@ -109,7 +109,7 @@ module.exports.users = {
rej(`Error when creating account: ${error.errors[0].msg} (${error.message})`);
}
}).catch((error) => {
rej(`Error when sending request to ${api}: ${error.code}`);
rej(`Error when sending request to ${api}: ${error.toString()}`);
});
});
},
@ -153,7 +153,7 @@ module.exports.users = {
res(newUser);
}).catch((error) => {
console.log(error)
rej(`Error when sending request to ${api}: ${error.code}`);
rej(`Error when sending request to ${api}: ${error.toString()}`);
});
});
}
@ -187,7 +187,7 @@ module.exports.categories = {
rej(`Error when creating category: ${data.message}`);
}
}).catch((error) => {
rej(`Error when sending request to ${api}: ${error.code}`);
rej(`Error when sending request to ${api}: ${error.toString()}`);
});
});
},
@ -213,7 +213,7 @@ module.exports.categories = {
}
res(data.categories);
}).catch((error) => {
rej(`Error while sending request to ${api}: ${error.code}`);
rej(`Error while sending request to ${api}: ${error.toString()}`);
});
});
},