improved error loggin and updated imports to fix build failure
This commit is contained in:
+2
-10
@@ -149,17 +149,9 @@ export const createContainer = async (containerName) => {
|
||||
.then((data) => {
|
||||
return data;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("has error", err);
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
});
|
||||
|
||||
//console.log(
|
||||
// "\n//////////////////\n container name :",
|
||||
// containerName,
|
||||
// "\n//////////////////\n"
|
||||
// );
|
||||
|
||||
console.log(createContainerResponse);
|
||||
return createContainerResponse;
|
||||
};
|
||||
|
||||
|
||||
+54
-38
@@ -39,6 +39,7 @@ export const getIP = (req) => {
|
||||
};
|
||||
|
||||
export const consoleLogger = (err) => {
|
||||
//console.log(err);
|
||||
var errStr =
|
||||
"\n\n/////////////////////////////////////////////////\nServer Error " +
|
||||
"\n" +
|
||||
@@ -72,8 +73,11 @@ export const consoleLogger = (err) => {
|
||||
(_.has(err, "config.url")
|
||||
? "\nAxios message url: " + err.message + "\n"
|
||||
: "") +
|
||||
(_.has(err, "config.data")
|
||||
? "\nRequest payload: " + err.config.data + "\n"
|
||||
: "") +
|
||||
"\n/////////////////////////////////////////////////\n\n";
|
||||
return errStr;
|
||||
console.log(errStr);
|
||||
};
|
||||
|
||||
export const conLog = (err) => {
|
||||
@@ -212,7 +216,7 @@ export const getBasicSearch = (searchString) => {
|
||||
return res.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
//console.log(error);
|
||||
consoleLogger(error);
|
||||
return error.response;
|
||||
});
|
||||
};
|
||||
@@ -228,7 +232,7 @@ export const getIncidentbyID = (searchString) => {
|
||||
return res.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
//console.log(error);
|
||||
consoleLogger(error);
|
||||
return error.response;
|
||||
});
|
||||
};
|
||||
@@ -242,7 +246,7 @@ export const getIsPublishedbyID = (searchString) => {
|
||||
return res.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
//console.log(error);
|
||||
consoleLogger(error);
|
||||
return error.response;
|
||||
});
|
||||
};
|
||||
@@ -258,7 +262,7 @@ export const getPartSavedAppeal = (searchString) => {
|
||||
return res.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
//console.log(error);
|
||||
consoleLogger(error);
|
||||
return error.response;
|
||||
});
|
||||
};
|
||||
@@ -274,7 +278,7 @@ export const getBasicDNSURLSearch = (searchString) => {
|
||||
return res.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
//console.log(error);
|
||||
consoleLogger(error);
|
||||
return error.response;
|
||||
});
|
||||
};
|
||||
@@ -303,6 +307,7 @@ export const getAddressSearchPaged = (
|
||||
return res.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
return error.response;
|
||||
});
|
||||
};
|
||||
@@ -331,6 +336,7 @@ export const getBasicSearchPaged = (
|
||||
return res.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
return error.response;
|
||||
});
|
||||
};
|
||||
@@ -342,6 +348,7 @@ export const getDNSCoords = () => {
|
||||
return res.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
let ErrResponse = {
|
||||
value: [],
|
||||
errorCode: error.response.status,
|
||||
@@ -357,6 +364,7 @@ export const getDNSList = (searchString) => {
|
||||
.get(BASE_URL + "/api/endpoint/getdnslist_api")
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
return error.response;
|
||||
});
|
||||
};
|
||||
@@ -366,6 +374,7 @@ export const getBasicDNSSearch = (searchString) => {
|
||||
.get(BASE_URL + "/api/endpoint/getbasicdnssearch_api")
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
return error.response;
|
||||
});
|
||||
};
|
||||
@@ -389,6 +398,7 @@ export const getBasicDNSSearchPaged = (
|
||||
)
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
return error.response;
|
||||
});
|
||||
};
|
||||
@@ -402,6 +412,7 @@ export const getAdvancedSearch = (searchString) => {
|
||||
)
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
let ErrResponse = {
|
||||
value: [],
|
||||
errorCode: error.response.status,
|
||||
@@ -434,6 +445,7 @@ export const getAdvancedSearchPaged = (
|
||||
)
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
let ErrResponse = {
|
||||
value: [],
|
||||
errorCode: error.response.status,
|
||||
@@ -594,7 +606,6 @@ export const getAppealsTypes = () => {
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
|
||||
let ErrResponse = {
|
||||
value: [],
|
||||
errorCode: error.response.status,
|
||||
@@ -610,7 +621,7 @@ export const getAppealsTypesForNewAppeal = () => {
|
||||
.get(BASE_URL + "/api/endpoint/getappealtypesfornewappeal_api")
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
//console.log(error);
|
||||
consoleLogger(error);
|
||||
let ErrResponse = {
|
||||
value: [],
|
||||
errorCode: error.response.status,
|
||||
@@ -628,6 +639,7 @@ export const getLPA = () => {
|
||||
return res.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
let ErrResponse = {
|
||||
value: [],
|
||||
errorCode: error.response.status,
|
||||
@@ -926,7 +938,7 @@ export const getRepsFromBlob = (containerName) => {
|
||||
// error +
|
||||
// "\n///////////////////////\n"
|
||||
// );
|
||||
console.log(consoleLogger(error));
|
||||
consoleLogger(error);
|
||||
//console.log("API call error", error);
|
||||
});
|
||||
};
|
||||
@@ -1070,9 +1082,8 @@ export const updateAccount = async (contactId, updateBody) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const createWatchedCases = (formValues) => {
|
||||
export const createWatchedCases = async (formValues) => {
|
||||
var data = formValues;
|
||||
//var queryUrl = window.apiRoot + "/api/endpoint/createwatchedcases_api";
|
||||
var queryUrl = "/api/endpoint/createwatchedcases_api";
|
||||
|
||||
var config = {
|
||||
@@ -1081,13 +1092,14 @@ export const createWatchedCases = (formValues) => {
|
||||
data: data,
|
||||
};
|
||||
|
||||
return axios(config)
|
||||
.then((res) => {
|
||||
return res.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
});
|
||||
console.log("===§=§=§=§=§=§=§=§=§=", config);
|
||||
|
||||
try {
|
||||
const res = await axios(config);
|
||||
return res.data;
|
||||
} catch (error) {
|
||||
consoleLogger(error);
|
||||
}
|
||||
};
|
||||
|
||||
export const createNewCase = (
|
||||
@@ -1778,10 +1790,10 @@ export const getPortalLogin = async (emailAddress) => {
|
||||
"/api/endpoint/getportallogin_api?emailAddress=" + emailAddress;
|
||||
|
||||
return axios
|
||||
.get(BASE_URL + queryUrl)
|
||||
.get(BASE_URL + queryUrl + hashAPIPath(queryUrl))
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
console.log(consoleLogger(error));
|
||||
consoleLogger(error);
|
||||
|
||||
return JSON.stringify(error);
|
||||
});
|
||||
@@ -1797,7 +1809,7 @@ export const createContainerProxy = (containerName) => {
|
||||
.get(BASE_URL + queryUrl)
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
console.log(consoleLogger(error));
|
||||
consoleLogger(error);
|
||||
|
||||
return JSON.stringify(error);
|
||||
});
|
||||
@@ -1886,21 +1898,25 @@ export const getAddressSearch = async (searchString) => {
|
||||
const params = new URLSearchParams(searchString);
|
||||
const str = params.toString();
|
||||
|
||||
//console.log(
|
||||
// "the url",
|
||||
// BASE_URL + "/api/endpoint/getbasicsearch_by_address_api?" + str
|
||||
// );
|
||||
try {
|
||||
const res = await axios.get(
|
||||
BASE_URL + "/api/endpoint/getbasicsearch_by_address_api?" + str
|
||||
);
|
||||
return res.data;
|
||||
} catch (error) {
|
||||
let ErrResponse = {
|
||||
value: [],
|
||||
errorCode: error.response.status,
|
||||
errorMsg: error.response.statusText,
|
||||
};
|
||||
return ErrResponse;
|
||||
}
|
||||
var queryUrl =
|
||||
BASE_URL + "/api/endpoint/getbasicsearch_by_address_api?" + str;
|
||||
|
||||
var config = {
|
||||
method: "get",
|
||||
url: queryUrl,
|
||||
};
|
||||
|
||||
return axios(config)
|
||||
.then((res) => {
|
||||
return res.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
let ErrResponse = {
|
||||
value: [],
|
||||
errorCode: error.response.status,
|
||||
errorMsg: error.response.statusText,
|
||||
};
|
||||
return ErrResponse;
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user