1
0

chore: Logging
All checks were successful
Remote Deploy / deploy (push) Successful in 4s

This commit is contained in:
2025-10-24 08:31:47 +02:00
parent d39206495c
commit 7fffbf6d06

View File

@@ -45,13 +45,21 @@ app.post("/report", async (req, res) => {
console.log(url)
const resp = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "text/plain",
},
body: `${content}\n\nClass: ${className}\nLocation: ${location}`,
});
let resp;
try {
resp = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "text/plain",
},
body: `${content}\n\nClass: ${className}\nLocation: ${location}`,
});
} catch (err) {
console.error('Fetch failed:', err.message);
console.error(err);
throw err;
}
if (!resp.ok) {
throw new Error(`Request failed`);