diff --git a/apps/server/src/collaboration/adapter/collab-ws.adapter.ts b/apps/server/src/collaboration/adapter/collab-ws.adapter.ts index b13005f4..9d84d8f9 100644 --- a/apps/server/src/collaboration/adapter/collab-ws.adapter.ts +++ b/apps/server/src/collaboration/adapter/collab-ws.adapter.ts @@ -23,7 +23,7 @@ export class CollabWsAdapter { socket.destroy(); } } catch (err) { - socket.end('HTTP/1.1 400\r\n' + err.message); + socket.end('HTTP/1.1 400\r\n' + (err as Error).message); } }); diff --git a/apps/server/src/collaboration/collaboration.util.ts b/apps/server/src/collaboration/collaboration.util.ts index 948fc9f4..6513e115 100644 --- a/apps/server/src/collaboration/collaboration.util.ts +++ b/apps/server/src/collaboration/collaboration.util.ts @@ -29,7 +29,7 @@ export const tiptapExtensions = [ TrailingNode, TextStyle, Color, -]; +] as any; export function jsonToHtml(tiptapJson: JSONContent) { return generateHTML(tiptapJson, tiptapExtensions); diff --git a/apps/server/src/core/attachment/attachment.service.ts b/apps/server/src/core/attachment/attachment.service.ts index d7c78d51..8257a9d0 100644 --- a/apps/server/src/core/attachment/attachment.service.ts +++ b/apps/server/src/core/attachment/attachment.service.ts @@ -77,7 +77,7 @@ export class AttachmentService { return attachment; } catch (err) { console.log(err); - throw new BadRequestException(err.message); + throw new BadRequestException('Failed to upload file'); } } @@ -119,7 +119,7 @@ export class AttachmentService { return attachment; } catch (err) { console.log(err); - throw new BadRequestException(err.message); + throw new BadRequestException('Failed to upload file'); } } @@ -158,7 +158,7 @@ export class AttachmentService { return attachment; } catch (err) { console.log(err); - throw new BadRequestException(err.message); + throw new BadRequestException('Failed to upload file'); } } } diff --git a/apps/server/src/integrations/storage/drivers/local.driver.ts b/apps/server/src/integrations/storage/drivers/local.driver.ts index 2a16f625..3b6cd731 100644 --- a/apps/server/src/integrations/storage/drivers/local.driver.ts +++ b/apps/server/src/integrations/storage/drivers/local.driver.ts @@ -20,24 +20,24 @@ export class LocalDriver implements StorageDriver { async upload(filePath: string, file: Buffer): Promise { try { await fs.outputFile(this._fullPath(filePath), file); - } catch (error) { - throw new Error(`Failed to upload file: ${error.message}`); + } catch (err) { + throw new Error(`Failed to upload file: ${(err as Error).message}`); } } async read(filePath: string): Promise { try { return await fs.readFile(this._fullPath(filePath)); - } catch (error) { - throw new Error(`Failed to read file: ${error.message}`); + } catch (err) { + throw new Error(`Failed to read file: ${(err as Error).message}`); } } async exists(filePath: string): Promise { try { return await fs.pathExists(this._fullPath(filePath)); - } catch (error) { - throw new Error(`Failed to check file existence: ${error.message}`); + } catch (err) { + throw new Error(`Failed to check file existence: ${(err as Error).message}`); } } @@ -52,8 +52,8 @@ export class LocalDriver implements StorageDriver { async delete(filePath: string): Promise { try { await fs.remove(this._fullPath(filePath)); - } catch (error) { - throw new Error(`Failed to delete file: ${error.message}`); + } catch (err) { + throw new Error(`Failed to delete file: ${(err as Error).message}`); } } diff --git a/apps/server/src/integrations/storage/drivers/s3.driver.ts b/apps/server/src/integrations/storage/drivers/s3.driver.ts index baf82fc0..a36d67b5 100644 --- a/apps/server/src/integrations/storage/drivers/s3.driver.ts +++ b/apps/server/src/integrations/storage/drivers/s3.driver.ts @@ -38,8 +38,8 @@ export class S3Driver implements StorageDriver { // we can get the path from location console.log(`File uploaded successfully: ${filePath}`); - } catch (error) { - throw new Error(`Failed to upload file: ${error.message}`); + } catch (err) { + throw new Error(`Failed to upload file: ${(err as Error).message}`); } } @@ -53,8 +53,8 @@ export class S3Driver implements StorageDriver { const response = await this.s3Client.send(command); return streamToBuffer(response.Body as Readable); - } catch (error) { - throw new Error(`Failed to read file from S3: ${error.message}`); + } catch (err) { + throw new Error(`Failed to read file from S3: ${(err as Error).message}`); } } @@ -96,7 +96,7 @@ export class S3Driver implements StorageDriver { await this.s3Client.send(command); } catch (err) { throw new Error( - `Error deleting file ${filePath} from S3. ${err.message}`, + `Error deleting file ${filePath} from S3. ${(err as Error).message}`, ); } }