error handling logging and debug to server console

This commit is contained in:
2022-07-19 11:51:16 +01:00
parent be9f86b6b2
commit 31738d38fa
61 changed files with 372 additions and 155 deletions
+4 -2
View File
@@ -1,5 +1,5 @@
import axios from "axios";
import { hashAPIPath } from "./";
import { hashAPIPath, consoleLogger } from "./";
const configEndpoint = process.env.GG_PROVIDER_CONFIG_ENDPOINT;
const ggClientID = process.env.GG_CLIENT_ID;
@@ -87,7 +87,9 @@ export const getPortalLogin = (emailAddress, token) => {
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
.then((res) => res.data)
.catch((error) => {
console.log("thiserror", error);
console.log(consoleLogger(error));
//console.log("thiserror", error);
return JSON.stringify(error);
});
};
+14 -2
View File
@@ -24,6 +24,18 @@ const WEBAPI_URL =
process.env.RELAY_ROOT ||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
export const consoleLogger = (err) => {
var errStr =
"///////\nServer Error " +
"\n" +
err.response.status +
" : " +
err.response.statusText +
"\n///////";
return errStr;
};
export const getToken = () => {
return axios
.post(
@@ -1027,7 +1039,7 @@ export const createAccount = (formValues) => {
export const uploadFiles = async (formValues, filesObj, uploadhash) => {
let files = filesObj;
console.log(formValues);
//console.log(formValues);
var formData = new FormData();
formData.append("appealData", JSON.stringify(formValues));
@@ -1040,7 +1052,7 @@ export const uploadFiles = async (formValues, filesObj, uploadhash) => {
}
}
console.log(formData);
//console.log(formData);
var queryUrl = "/api/file/upload";