error handling logging and debug to server console
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
import axios from "axios";
|
||||
import CryptoJS from "crypto-js";
|
||||
import _ from "lodash";
|
||||
import { getToken, azureHeaders, azureHeadersPaged } from "../../../actions";
|
||||
import {
|
||||
getToken,
|
||||
azureHeaders,
|
||||
azureHeadersPaged,
|
||||
consoleLogger,
|
||||
} from "../../../actions";
|
||||
|
||||
const WORDKEY = process.env.HASHKEY;
|
||||
|
||||
@@ -41,7 +46,8 @@ export default async function ApiProxy(req, res) {
|
||||
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
|
||||
res.status(200).json(data);
|
||||
})
|
||||
.catch(({ err }) => {
|
||||
.catch((err) => {
|
||||
console.log(consoleLogger(err));
|
||||
res.status(400).json(err);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user