chore: Add more descriptive error for missing file system permission
This commit is contained in:
@@ -47,7 +47,16 @@ router.post(
|
|||||||
throw AuthorizationError("Invalid key");
|
throw AuthorizationError("Invalid key");
|
||||||
}
|
}
|
||||||
|
|
||||||
await attachment.writeFile(file);
|
try {
|
||||||
|
await attachment.writeFile(file);
|
||||||
|
} catch (err) {
|
||||||
|
if (err.message.includes("permission denied")) {
|
||||||
|
throw Error(
|
||||||
|
`Permission denied writing to "${key}". Check the host machine file system permissions.`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
|
||||||
ctx.body = {
|
ctx.body = {
|
||||||
success: true,
|
success: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user