Update debug messages
This commit is contained in:
parent
0085f16a12
commit
4b67191aab
@ -18,10 +18,10 @@ export default function handler(req: NextApiRequest, res: NextApiResponse<string
|
||||
try {
|
||||
const path = resolve("./public", "projects", "list.json");
|
||||
const data = readFileSync(path).toString();
|
||||
console.debug("[API/get_project]\tRequest for project list");
|
||||
console.debug("[API/projects]\tRequest for project list");
|
||||
res.status(200).send(data);
|
||||
} catch (err) {
|
||||
console.error(`[API/get_project]\tError in request for project list! Code: ${(err as IFileError).code}`);
|
||||
console.error(`[API/projects]\tError in request for project list! Code: ${(err as IFileError).code}`);
|
||||
res.status(500);
|
||||
} finally {
|
||||
res.end();
|
||||
|
@ -21,10 +21,10 @@ export default function handler(req: NextApiRequest, res: NextApiResponse<string
|
||||
try {
|
||||
const path = resolve("./public", "projects", `${project}.adoc`);
|
||||
const data = readFileSync(path).toString();
|
||||
console.debug(`[API/get_project]\tRequest for ${project}`);
|
||||
console.debug(`[API/projects]\tRequest for ${project}`);
|
||||
res.status(200).send(data);
|
||||
} catch (err) {
|
||||
console.error(`[API/get_project]\tError in request for ${project}! Code: ${(err as IFileError).code}`);
|
||||
console.error(`[API/projects]\tError in request for ${project}! Code: ${(err as IFileError).code}`);
|
||||
if ((err as IFileError).code === "ENOENT") res.status(404);
|
||||
else res.status(500);
|
||||
} finally {
|
||||
|
Loading…
Reference in New Issue
Block a user