fix error handling
This commit is contained in:
+3
-4
@@ -126,8 +126,7 @@ async function writeMountFile(volume) {
|
||||
}
|
||||
|
||||
const mountFileContents = ejs.render(SYSTEMD_MOUNT_EJS, { name, what, where: hostPath, options, type });
|
||||
const [error] = await safe(shell.promises.sudo('generateMountFile', [ ADD_MOUNT_CMD, mountFileContents ], {}));
|
||||
if (error) throw error;
|
||||
await shell.promises.sudo('generateMountFile', [ ADD_MOUNT_CMD, mountFileContents ], {});
|
||||
}
|
||||
|
||||
async function removeMountFile(volume) {
|
||||
@@ -145,9 +144,9 @@ async function update(volume, mountType, mountOptions) {
|
||||
if (error) throw error;
|
||||
|
||||
if (mountType === 'noop') {
|
||||
await safe(removeMountFile(Object.assign({}, volume, { mountType, mountOptions })));
|
||||
await removeMountFile(Object.assign({}, volume, { mountType, mountOptions }));
|
||||
} else {
|
||||
await safe(writeMountFile(Object.assign({}, volume, { mountType, mountOptions })));
|
||||
await writeMountFile(Object.assign({}, volume, { mountType, mountOptions }));
|
||||
}
|
||||
|
||||
let result;
|
||||
|
||||
Reference in New Issue
Block a user