error handling logging and debug to server console
This commit is contained in:
@@ -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
@@ -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";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user