added in more debug to investigate
This commit is contained in:
@@ -140,7 +140,7 @@ export const createBlobSas = async (containerName, blobName) => {
|
|||||||
|
|
||||||
export const createContainer = async (containerName) => {
|
export const createContainer = async (containerName) => {
|
||||||
const creds = new DefaultAzureCredential();
|
const creds = new DefaultAzureCredential();
|
||||||
|
console.log(JSON.stringify(creds));
|
||||||
//containerName = containerName.toLowerCase();
|
//containerName = containerName.toLowerCase();
|
||||||
|
|
||||||
//console.log(
|
//console.log(
|
||||||
@@ -159,6 +159,7 @@ export const createContainer = async (containerName) => {
|
|||||||
const createContainerResponse = await containerClient
|
const createContainerResponse = await containerClient
|
||||||
.createIfNotExists()
|
.createIfNotExists()
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
|
console.log(data);
|
||||||
return data;
|
return data;
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
|||||||
+9
-1
@@ -45,6 +45,7 @@ export const consoleLogger = (err) => {
|
|||||||
"\n" +
|
"\n" +
|
||||||
(_.has(err, "name") ? "Name: " + err.name + "\n" : "") +
|
(_.has(err, "name") ? "Name: " + err.name + "\n" : "") +
|
||||||
(_.has(err, "code") ? "Code: " + err.code + "\n" : "") +
|
(_.has(err, "code") ? "Code: " + err.code + "\n" : "") +
|
||||||
|
(_.has(err, "query") ? "Query: " + err.query + "\n" : "") +
|
||||||
(_.has(err, "message") ? "Message: " + err.message + "\n" : "") +
|
(_.has(err, "message") ? "Message: " + err.message + "\n" : "") +
|
||||||
(_.has(err, "request.url")
|
(_.has(err, "request.url")
|
||||||
? "request.url: " + err.request.url + "\n"
|
? "request.url: " + err.request.url + "\n"
|
||||||
@@ -76,7 +77,14 @@ export const consoleLogger = (err) => {
|
|||||||
(_.has(err, "config.data")
|
(_.has(err, "config.data")
|
||||||
? "\nRequest payload: " + err.config.data + "\n"
|
? "\nRequest payload: " + err.config.data + "\n"
|
||||||
: "") +
|
: "") +
|
||||||
"\n/////////////////////////////////////////////////\n\n";
|
"\n/////////////////////////////////////////////////\n" +
|
||||||
|
(_.has(err, "response")
|
||||||
|
? "\n/////////////////////////////////////////////////\n\n" +
|
||||||
|
"Raw error.response: " +
|
||||||
|
JSON.stringify(err.response) +
|
||||||
|
"\n/////////////////////////////////////////////////\n\n"
|
||||||
|
: "");
|
||||||
|
|
||||||
console.log(errStr);
|
console.log(errStr);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -24,13 +24,18 @@ ApiProxy.get(async (req, res) => {
|
|||||||
if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
|
if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
|
||||||
await createContainer(containerName)
|
await createContainer(containerName)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
return res.status(200).json({ data: "success" });
|
return res.status(200).json({ data: "success", output: data });
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
consoleLogger(error);
|
consoleLogger(error);
|
||||||
res.status(400).json(error);
|
res.status(400).json(error);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
consoleLogger({
|
||||||
|
name: "setupcontainer",
|
||||||
|
code: "bad hash",
|
||||||
|
query: JSON.stringify(req.query),
|
||||||
|
});
|
||||||
return res.status(400).json();
|
return res.status(400).json();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user