FilesystemBackend: Fix ESLint errors

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-02-26 12:24:35 +01:00
parent 0a23538389
commit 73db821649
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3

View file

@ -38,7 +38,7 @@ export class FilesystemBackend implements MediaBackend {
await fs.writeFile(filePath, buffer, null);
return ['/' + filePath, null];
} catch (e) {
this.logger.error(e.message, e.stack, 'saveFile');
this.logger.error((e as Error).message, (e as Error).stack, 'saveFile');
throw new MediaBackendError(`Could not save '${filePath}'`);
}
}
@ -48,7 +48,7 @@ export class FilesystemBackend implements MediaBackend {
try {
return await fs.unlink(filePath);
} catch (e) {
this.logger.error(e.message, e.stack, 'deleteFile');
this.logger.error((e as Error).message, (e as Error).stack, 'deleteFile');
throw new MediaBackendError(`Could not delete '${filePath}'`);
}
}
@ -73,7 +73,11 @@ export class FilesystemBackend implements MediaBackend {
);
await fs.mkdir(this.uploadDirectory);
} catch (e) {
this.logger.error(e.message, e.stack, 'deleteFile');
this.logger.error(
(e as Error).message,
(e as Error).stack,
'deleteFile',
);
throw new MediaBackendError(
`Could not create '${this.uploadDirectory}'`,
);