Improve error handling for add fees #61

Merged
bilal.catic merged 2 commits from improve-error-handling-for-addFees into master 2019-10-04 16:57:58 +02:00
Showing only changes of commit 7f65a6784f - Show all commits

View File

@@ -3,6 +3,7 @@
const db = require('../../models/index');
const { API } = require('../../helpers/api');
const { officeRnDAPIErrors } = require('../../constants/constants');
const fetchOffices = () => {
return new Promise((resolve, reject) => {
@@ -41,7 +42,8 @@ const fetchResources = () => {
resolve(cleanedResources);
})
.catch((error) => {
reject(error);
console.log("[Fetch resources] Failed to fetch resources : ", error);
reject(officeRnDAPIErrors.FAILED_TO_FETCH_RESOURCES);
});
});
};